Frame 1
stop();
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
_root.menu = myMenu;
medal_popup.swapDepths(500000);
ngConnector.swapDepths(500001);
_root.API_Settings = {movie_id:6685, enc_key:"REjTEJAROBIFFZfPuYq1wQFgenfC3SNY", debug_mode:false, movie_version:""};
Frame 2
stop();
btnSkip.onPress = function () {
play();
};
Frame 3
function addMusic(sound, loop) {
cMusic = sound;
music.stop();
music.attachSound(sound);
music.start(0, loop);
}
stop();
var mPopX = medal_popup._x;
var mPopY = medal_popup._y;
var mScale = medal_popup._xscale;
var ngConX = ngConnector._x;
var ngConY = ngConnector._y;
var ngConScale = ngConnector._xscale;
mScreen.btnPlay.onRelease = function () {
stopAllSounds();
_root.gotoAndStop("gameScreen");
};
mScreen.btnMedals.onRelease = function () {
_root.mScreen.gotoAndStop("medals");
};
mScreen.btnControls.onRelease = function () {
_root.mScreen.gotoAndStop("controls");
};
var music = new Sound(this);
_root.addMusic("pk_music", 9999);
_quality = "HIGH";
Frame 4
function addBoundObject(obj, iden, wid, het, dep, x, y, z, typ, anim, shad) {
objects.attachMovie(obj, iden, objects.getNextHighestDepth());
temp = objects[iden];
temp.setProperties(wid, het, dep, x, y, z, typ, anim);
temp.render();
if (shad) {
addBoundObject("shadow", "shadow" + secondaryObjects, wid, het, dep, x, 210, z + 10, "shadow", false, false);
objects["shadow" + secondaryObjects].shadowTarget = objects[iden];
objects["shadow" + secondaryObjects].scaler = objects[iden].wide;
objects[iden].followShadow = objects["shadow" + secondaryObjects];
secondaryObjects++;
}
}
function hitCheck(ob1, ob2) {
c1 = ob1.coord;
c2 = ob2.coord;
boolTemp = false;
if ((((((c1.x - (ob1.wide / 2)) < (c2.x + (ob2.wide / 2))) && ((c1.x - (ob1.wide / 2)) > (c2.x - (ob2.wide / 2)))) || (((c1.x + (ob1.wide / 2)) < (c2.x + (ob2.wide / 2))) && ((c1.x + (ob1.wide / 2)) > (c2.x - (ob2.wide / 2))))) || (((c2.x - (ob2.wide / 2)) < (c1.x + (ob1.wide / 2))) && ((c2.x - (ob2.wide / 2)) > (c1.x - (ob1.wide / 2))))) || (((c2.x + (ob2.wide / 2)) < (c1.x + (ob1.wide / 2))) && ((c2.x + (ob2.wide / 2)) > (c1.x - (ob1.wide / 2))))) {
if (((((c1.y > (c2.y - ob2.high)) && (c1.y < c2.y)) || (((c1.y - ob1.high) > (c2.y - ob2.high)) && ((c1.y - ob1.high) < c2.y))) || ((c2.y > (c1.y - ob1.high)) && (c2.y < c1.y))) || (((c2.y - ob2.high) > (c1.y - ob1.high)) && ((c2.y - ob2.high) < c1.y))) {
if ((((((c1.z + (ob1.long / 2)) > (c2.z - (ob2.long / 2))) && ((c1.z + (ob1.long / 2)) < (c2.z + (ob2.long / 2)))) || (((c1.z - (ob1.long / 2)) > (c2.z - (ob2.long / 2))) && ((c1.z - (ob1.long / 2)) < (c2.z + (ob2.long / 2))))) || (((c2.z + (ob2.long / 2)) > (c1.z - (ob1.long / 2))) && ((c2.z + (ob2.long / 2)) < (c1.z + (ob1.long / 2))))) || (((c2.z - (ob2.long / 2)) > (c1.z - (ob1.long / 2))) && ((c2.z - (ob2.long / 2)) < (c1.z + (ob1.long / 2))))) {
boolTemp = true;
}
}
}
return(boolTemp);
}
function cameraStuff() {
var _local2 = objects.pinkKnight._x - objects.cwKnight._x;
_root.camPosX = (objects.pinkKnight._x + objects._x) - (_local2 / 3);
if (camPosX > 1700) {
camPosX = 1700;
} else if (camPosX < 200) {
camPosX = 200;
}
shakeDuration--;
if (shakeDuration <= 0) {
shakeStrength = 0;
}
camera._x = (camPosX + (Math.random() * shakeStrength)) - (shakeStrength / 2);
camera._y = (camPosY + (Math.random() * shakeStrength)) - (shakeStrength / 2);
objects.stage.bgMountains._x = objects.stage.defaultX + ((camera._x - objects.stage.defaultTargetX) / 10);
objects.stage.bgMountains._y = ((-objects.pinkKnight.coord.z) / 20) + 190;
medal_popup._xscale = (medal_popup._yscale = 200);
medal_popup._x = (camera._x - (medal_popup._width / 2)) - 545;
medal_popup._y = 467;
ngConnector._xscale = (ngConnector._yscale = 180);
ngConnector._x = camera._x - (ngConnector._width / 2);
}
function hudStuff() {
objects.hud.bossBar.bossHealthBar._xscale = (objects.cwKnight.manHealth / objects.cwKnight.maxManHealth) * 100;
objects.hud.bossBar.bossOutterBar._xscale = (objects.cwKnight.health / objects.cwKnight.maxHealth) * 100;
objects.hud.bossBar.sparks._x = 404 - ((objects.cwKnight.health / objects.cwKnight.maxHealth) * 614);
objects.hud.bossBar.sparks2._x = 404 - ((objects.cwKnight.health / objects.cwKnight.maxHealth) * 614);
objects.hud.pkHealthBar.masker._xscale = ((objects.pinkKnight.health / objects.pinkKnight.maxHealth) * 100) * iPKHealth;
objects.hud.pkStaminaBar.masker._xscale = ((objects.pinkKnight.stamina * iPKStamina) * 5) / 6;
if (oldScore != totalScore) {
if (totalScore < 0) {
totalScore = 0;
} else if (totalScore > 999999) {
totalScore = 999999 /* 0x0F423F */;
}
tScoreString = "";
tScoreString = tScoreString + totalScore;
i = 0;
while (i < tScoreString.length) {
num = (tScoreString.length - i) - 1;
objects.hud["slot" + i].gotoAndStop(tScoreString.charAt(num));
objects.hud["slot" + i].gotoAndStop(objects.hud["slot" + i]._currentframe + 1);
if (tScoreString.charAt(num) == "0") {
objects.hud["slot" + i].gotoAndStop(1);
}
i++;
}
i = 0;
while (i < (6 - tScoreString.length)) {
objects.hud["slot" + ((6 - i) - 1)].gotoAndStop(1);
i++;
}
}
}
function addSound(sound, loop) {
this["newSound" + soundVar] = new Sound(this);
this["newSound" + soundVar].attachSound(sound);
this["newSound" + soundVar].start(0, loop);
soundVar++;
if (soundVar > 30) {
soundVar = 1;
}
}
stop();
var qualityWait = 0;
var qualityPos = 2;
var unlocks = new Array();
unlocks = [false, false, false, false, false, false, false, false, false, false];
var rightBound = 1100;
var leftBound = -1250;
var upperBound = 600;
var lowerBound = 280;
var startTimer = 0;
var pauseOn = 1;
var pauseWait = 0;
var linkedObjects = 1;
var secondaryObjects = 1;
var birds = false;
var birdsBomb = false;
var totalScore = 0;
var oldScore = 0;
var totalDizzies = 0;
var finalWin = false;
var shootDeflects = 0;
var minionFartDeaths = 0;
var kissFinish = false;
var flashTimer = -1;
this.attachMovie("camera", "camera", 1000);
camera._width = Stage.width * 2.1;
camera._height = Stage.height * 2.1;
var camPosY = ((Stage.height / 2) + 70);
var camPosX = 0;
var shakeDuration = 0;
var shakeStrength = 0;
this.createEmptyMovieClip("objects", 100);
objects._x = 970;
objects._y = 330;
addBoundObject("pinkKnight", "pinkKnight", 60, 100, 40, -300, 210, 500, "pinkKnight", true, true);
addBoundObject("cwKnight", "cwKnight", 200, 140, 100, 400, 210, 500, "cwKnight", true, true);
addBoundObject("stage", "stage", 50, 100, 40, 0, -5, -200, "stage", false, false);
objects.stage.defaultX = objects.stage.bgMountains._x;
objects.stage.defaultTargetX = camera._x;
objects.stage.cacheAsBitmap = true;
objects.attachMovie("theHUD", "hud", 100000);
var iPKHealth = (objects.hud.pkHealthBar.masker._xscale / 100);
var iPKStamina = (objects.hud.pkStaminaBar.masker._xscale / 100);
camera.btnQuality.onPress = function () {
if (qualityPos == 1) {
qualityPos = 3;
} else if (qualityPos == 2) {
qualityPos = 1;
} else {
qualityPos = 2;
}
};
onEnterFrame = function () {
qualityWait--;
if (qualityPos == 1) {
_quality = "LOW";
if (Key.isDown(81) && (qualityWait <= 0)) {
qualityPos = 3;
qualityWait = 10;
}
} else if (qualityPos == 2) {
_quality = "MEDIUM";
if (Key.isDown(81) && (qualityWait <= 0)) {
qualityPos = 1;
qualityWait = 10;
}
} else {
_quality = "HIGH";
if (Key.isDown(81) && (qualityWait <= 0)) {
qualityPos = 2;
qualityWait = 10;
}
}
if (Key.isDown(82)) {
gotoAndStop ("retryScreen");
}
oldScore = totalScore;
if (Key.isDown(80) && (pauseWait <= 0)) {
pauseOn = pauseOn * -1;
pauseWait = 8;
} else {
pauseWait--;
}
if ((pauseOn == 1) && (!finalWin)) {
startTimer++;
var _local3 = "";
for (_local3 in objects) {
objects[_local3].act();
}
cameraStuff();
hudStuff();
} else if (finalWin) {
if (white_flash == undefined) {
this.attachMovie("white_flash", "white_flash", 499999);
white_flash._x = camera._x;
white_flash._y = camera._y;
white_flash._xscale = (white_flash._yscale = 4000);
white_flash._alpha = 0;
}
white_flash._alpha = white_flash._alpha + 5;
if (white_flash._alpha >= 100) {
white_flash._alpha = 100;
}
flashTimer--;
var _local4 = com.Newgrounds.NewgroundsAPI.getMedals();
if ((flashTimer == 70) && (!unlocks[3])) {
_root.medal_popup.unlockMedal("YouWin");
unlocks[3] = true;
flashTimer = flashTimer + 60;
} else if (((flashTimer == 69) && (totalDizzies == 0)) && (!unlocks[4])) {
_root.medal_popup.unlockMedal("CuttinOutSweets");
unlocks[4] = true;
flashTimer = flashTimer + 60;
} else if (((flashTimer == 68) && (kissFinish)) && (!unlocks[1])) {
_root.medal_popup.unlockMedal("JuiceyKisses");
unlocks[1] = true;
flashTimer = flashTimer + 60;
} else if (((flashTimer == 67) && (startTimer < 8000)) && (!unlocks[9])) {
_root.medal_popup.unlockMedal("TimeAttack");
unlocks[9] = true;
flashTimer = flashTimer + 60;
} else if (((flashTimer == 66) && (totalScore > 12000)) && (!unlocks[8])) {
_root.medal_popup.unlockMedal("Tilt");
unlocks[8] = true;
flashTimer = flashTimer + 60;
} else if (flashTimer == 0) {
stopAllSounds();
gotoAndStop ("winScreen");
}
}
};
var soundVar = 1;
_root.addMusic("music1", 9999);
Frame 5
stop();
objects.removeMovieClip();
camera.removeMovieClip();
objects.removeMovieClip();
ngConnector.removeMovieClip();
_x = 0;
_y = 0;
_yscale = 100;
_xscale = 100;
white_flash._x = 400;
white_flash._y = 175;
onEnterFrame = function () {
_x = 0;
_y = 0;
white_flash._alpha = white_flash._alpha - 5;
if (white_flash._alpha <= 0) {
white_flash.removeMovieClip();
}
};
_quality = "HIGH";
Frame 6
stop();
btnBack.onPress = function () {
_root.gotoAndStop("menuScreen");
};
Frame 7
stop();
objects.removeMovieClip();
camera.removeMovieClip();
objects.removeMovieClip();
ngConnector.removeMovieClip();
stopAllSounds();
_x = 0;
_y = 0;
_yscale = 100;
_xscale = 100;
onEnterFrame = function () {
_x = 0;
_y = 0;
};
btnBack.onPress = function () {
_root.gotoAndStop("menuScreen");
};
_quality = "HIGH";
Frame 8
stop();
objects.removeMovieClip();
camera.removeMovieClip();
objects.removeMovieClip();
ngConnector.removeMovieClip();
stopAllSounds();
_x = 0;
_y = 0;
_yscale = 100;
_xscale = 100;
white_flash.removeMovieClip();
var waitForIt = 5;
onEnterFrame = function () {
_x = 0;
_y = 0;
waitForIt--;
if (waitForIt <= 0) {
this.gotoAndStop("gameScreen");
}
};
Symbol 53 MovieClip Frame 1
onEnterFrame = function () {
if (_root.pauseOn == -1) {
_parent.stop();
} else {
_parent.play();
}
};
Symbol 56 MovieClip [dizzyRecoveryMash] Frame 1
var loops = 20;
Symbol 56 MovieClip [dizzyRecoveryMash] Frame 8
loops--;
if (loops <= 0) {
this.removeMovieClip();
}
gotoAndPlay (2);
Symbol 70 MovieClip [medal_popup_copy] 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 70 MovieClip [medal_popup_copy] Frame 10
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Symbol 73 Button
on (release) {
this._visible = false;
}
Symbol 81 MovieClip [connector_copy] 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 105 MovieClip [minusNumber] Frame 1
#initclip 58
Object.registerClass("minusNumber", ScoreNumber);
#endinitclip
Symbol 112 MovieClip [plus500] Frame 1
#initclip 26
Object.registerClass("plus500", ScoreNumber);
#endinitclip
Symbol 115 MovieClip [plus200] Frame 1
#initclip 27
Object.registerClass("plus200", ScoreNumber);
#endinitclip
Symbol 118 MovieClip [plus1000] Frame 1
#initclip 28
Object.registerClass("plus1000", ScoreNumber);
#endinitclip
Symbol 119 MovieClip [plus100] Frame 1
#initclip 29
Object.registerClass("plus100", ScoreNumber);
#endinitclip
Symbol 120 MovieClip [plus5] Frame 1
#initclip 30
Object.registerClass("plus5", ScoreNumber);
#endinitclip
Symbol 121 MovieClip [plus20] Frame 1
#initclip 31
Object.registerClass("plus20", ScoreNumber);
#endinitclip
Symbol 122 MovieClip [plus10] Frame 1
#initclip 32
Object.registerClass("plus10", ScoreNumber);
#endinitclip
Symbol 123 MovieClip [plus50] Frame 1
#initclip 33
Object.registerClass("plus50", ScoreNumber);
#endinitclip
Symbol 138 MovieClip [smokePuff] Frame 1
#initclip 34
Object.registerClass("smokePuff", SmokePuff);
#endinitclip
Symbol 138 MovieClip [smokePuff] Frame 33
this.removeMovieClip();
Symbol 148 MovieClip [blackBirdFace] Frame 1
#initclip 35
Object.registerClass("blackBirdFace", BlackBirdFace);
#endinitclip
Symbol 164 MovieClip [kissSplat] Frame 1
#initclip 36
Object.registerClass("kissSplat", Effect);
#endinitclip
Symbol 164 MovieClip [kissSplat] Frame 25
this.removeMovieClip();
Symbol 194 MovieClip Frame 19
stop();
Symbol 217 MovieClip [levelDown] Frame 1
#initclip 37
Object.registerClass("levelDown", LevelUpAnim);
#endinitclip
Symbol 217 MovieClip [levelDown] Frame 31
this.removeMovieClip();
Symbol 223 MovieClip Frame 25
stop();
Symbol 226 MovieClip [textBoxer] Frame 1
var timer = 140;
onEnterFrame = function () {
timer--;
if (timer == 0) {
gotoAndPlay (21);
}
};
Symbol 226 MovieClip [textBoxer] Frame 10
gotoAndStop(stopFrame);
Symbol 226 MovieClip [textBoxer] Frame 47
this.removeMovieClip();
Symbol 233 MovieClip [kLevelUp] Frame 1
this.attachMovie("textBoxer", "textBoxer", 123);
kFace.swapDepths(125);
textBoxer._x = 100;
textBoxer._y = -150;
var loops = 13;
if (_root.objects.pinkKnight.levelUp == 4) {
textBoxer.stopFrame = 19;
} else if (_root.objects.pinkKnight.levelUp == 5) {
textBoxer.stopFrame = 19;
} else if (_root.objects.pinkKnight.levelUp == 3) {
textBoxer.stopFrame = 15;
} else if (_root.objects.pinkKnight.levelUp == 2) {
textBoxer.stopFrame = 13;
}
Symbol 233 MovieClip [kLevelUp] Frame 11
loops--;
if (loops <= 0) {
this.removeMovieClip();
} else {
gotoAndPlay (2);
}
Symbol 238 MovieClip [kLevelDown] Frame 1
this.attachMovie("textBoxer", "textBoxer", 123);
kFace.swapDepths(125);
textBoxer._x = 100;
textBoxer._y = -150;
var loops = 25;
if (_root.objects.pinkKnight.levelUp == 3) {
textBoxer.stopFrame = 20;
} else if (_root.objects.pinkKnight.levelUp == 4) {
textBoxer.stopFrame = 20;
} else if (_root.objects.pinkKnight.levelUp == 2) {
textBoxer.stopFrame = 16;
} else if (_root.objects.pinkKnight.levelUp == 1) {
textBoxer.stopFrame = 14;
}
Symbol 238 MovieClip [kLevelDown] Frame 5
loops--;
if (loops <= 0) {
this.removeMovieClip();
} else {
gotoAndPlay (2);
}
Symbol 256 MovieClip [pinkFart] Frame 1
#initclip 38
Object.registerClass("pinkFart", PinkFart);
#endinitclip
Symbol 256 MovieClip [pinkFart] Frame 26
this.removeMovieClip();
Symbol 278 MovieClip [groundExplosionDust] Frame 1
#initclip 39
Object.registerClass("groundExplosionDust", Effect);
#endinitclip
Symbol 278 MovieClip [groundExplosionDust] Frame 31
stop();
this.removeMovieClip();
Symbol 291 MovieClip [footDust] Frame 1
#initclip 40
Object.registerClass("footDust", Effect);
#endinitclip
Symbol 291 MovieClip [footDust] Frame 24
this.removeMovieClip();
Symbol 305 MovieClip [cannonBallAir] Frame 1
#initclip 41
Object.registerClass("cannonBallAir", Effect);
#endinitclip
Symbol 305 MovieClip [cannonBallAir] Frame 28
this.removeMovieClip();
Symbol 321 MovieClip [projectileHit] Frame 1
#initclip 42
Object.registerClass("projectileHit", Effect);
#endinitclip
Symbol 321 MovieClip [projectileHit] Frame 27
this.removeMovieClip();
Symbol 333 MovieClip [hitsparkz] Frame 1
#initclip 43
Object.registerClass("hitsparkz", Effect);
#endinitclip
Symbol 333 MovieClip [hitsparkz] Frame 10
this.removeMovieClip();
Symbol 339 MovieClip [camera] Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local4 = sX / ((this.camPart._width * _xscale) / 100);
var _local3 = sY / ((this.camPart._height * _xscale) / 100);
_parent._x = cX - (this._x * _local4);
_parent._y = cY - (this._y * _local3);
_parent._xscale = 100 * _local4;
_parent._yscale = 100 * _local3;
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
stop();
camPart._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Symbol 384 MovieClip Frame 11
_parent.play();
Symbol 385 MovieClip Frame 1
stop();
Symbol 385 MovieClip Frame 2
stop();
Symbol 387 MovieClip [stage] Frame 1
#initclip 44
Object.registerClass("stage", StasisObject);
#endinitclip
Symbol 394 MovieClip Frame 1
stop();
Symbol 439 MovieClip Frame 1
_root.shakeDuration = 2;
_root.shakeStrength = 4;
Symbol 445 MovieClip Frame 4
_root.addSound("brickfall", 1);
Symbol 445 MovieClip Frame 7
if (_parent.hitRange == null) {
_parent.hitRange = new ObjectProperties();
}
_parent.hitRange.coord.x = _parent.coord.x + (250 * _parent.dir);
_parent.hitRange.coord.y = _parent.coord.y;
_parent.hitRange.coord.z = _parent.coord.z;
_parent.hitRange.wide = 200;
_parent.hitRange.high = 200;
_parent.hitRange.long = 90;
if (_root.hitCheck(_root.objects.pinkKnight, _parent.hitRange)) {
if (_root.objects.pinkKnight.blocking && (_root.objects.pinkKnight.dir == (-_parent.dir))) {
_root.addSound("pk_block", 1);
_root.addSound("pk_block", 1);
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, _root.objects.pinkKnight.coord.x, _root.objects.pinkKnight.coord.y - 5, _root.objects.pinkKnight.coord.z - 20, "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = _root.objects.pinkKnight.dir;
_root.linkedObjects++;
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, _root.objects.pinkKnight.coord.x, _root.objects.pinkKnight.coord.y - 5, _root.objects.pinkKnight.coord.z - 20, "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = _root.objects.pinkKnight.dir;
_root.linkedObjects++;
_root.objects.pinkKnight.xSlide = _parent.dir * 45;
} else {
_root.objects.pinkKnight.hit(30, -_parent.dir, 5);
}
}
_root.addBoundObject("groundExplosion", "groundExplosion" + _root.linkedObjects, 10, 10, 10, _parent.coord.x + (_parent.dir * 320), _parent.coord.y + 1, _parent.coord.z - 5, "groundExplosion", true, false);
_root.linkedObjects++;
_root.shakeDuration = 10;
_root.shakeDuration = 12;
_root.objects.stage.stageSetting.otherKnights.play();
Symbol 445 MovieClip Frame 15
_parent.gotoAndStop("idle");
Symbol 462 MovieClip Frame 8
if (_parent.hitRange == null) {
_parent.hitRange = new ObjectProperties();
}
_parent.hitRange.coord.x = _parent.coord.x + (250 * _parent.dir);
_parent.hitRange.coord.y = 209;
_parent.hitRange.coord.z = _parent.coord.z;
_parent.hitRange.wide = 200;
_parent.hitRange.high = 28;
_parent.hitRange.long = 100;
var additional = ((450 - _parent.coord.z) / 10);
onEnterFrame = function () {
if (_root.pauseOn == 1) {
_parent.hitRange.coord.x = _parent.hitRange.coord.x + ((_parent.dir * 72) + (additional * _parent.dir));
if ((_currentframe % 2) == 0) {
_root.addBoundObject("groundExplosionDust", "groundExplosionDust" + _root.linkedObjects, 50, 100, 40, _parent.hitRange.coord.x + (35 * _parent.dir), 212, (_parent.coord.z - 10) - Math.round(Math.random() * 10), "groundExplo", true, false);
_root.objects["groundExplosionDust" + _root.linkedObjects]._rotation = (-(Math.random() * 15)) * _parent.dir;
_root.linkedObjects++;
}
if (_root.hitCheck(_root.objects.pinkKnight, _parent.hitRange)) {
if (_root.objects.pinkKnight.blocking && (_root.objects.pinkKnight.dir == (-_parent.dir))) {
_root.addSound("pk_block", 1);
_root.addSound("pk_block", 1);
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, _root.objects.pinkKnight.coord.x, _root.objects.pinkKnight.coord.y - 5, _root.objects.pinkKnight.coord.z - 20, "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = _root.objects.pinkKnight.dir;
_root.linkedObjects++;
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, _root.objects.pinkKnight.coord.x, _root.objects.pinkKnight.coord.y - 5, _root.objects.pinkKnight.coord.z - 20, "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = _root.objects.pinkKnight.dir;
_root.linkedObjects++;
_root.objects.pinkKnight.xSlide = _parent.dir * 45;
_parent.gotoAndStop("idle");
} else {
_root.objects.pinkKnight.hit(30, -_parent.dir, 5);
}
}
}
};
Symbol 462 MovieClip Frame 25
onEnterFrame = function () {
};
Symbol 462 MovieClip Frame 26
onEnterFrame = function () {
if (_root.pauseOn == 1) {
if ((_currentframe % 2) == 0) {
_root.addBoundObject("groundExplosionDust", "groundExplosionDust" + _root.linkedObjects, 50, 100, 40, _parent.hitRange.coord.x - (300 * _parent.dir), 212, (_parent.coord.z - 10) - Math.round(Math.random() * 10), "groundExplo", true, false);
_root.objects["groundExplosionDust" + _root.linkedObjects]._rotation = (Math.random() * 15) * _parent.dir;
_root.linkedObjects++;
}
_parent.hitRange.coord.x = _parent.hitRange.coord.x - ((_parent.dir * 72) + (additional * _parent.dir));
if (_root.hitCheck(_root.objects.pinkKnight, _parent.hitRange)) {
if (_root.objects.pinkKnight.blocking && (_root.objects.pinkKnight.dir == _parent.dir)) {
_root.addSound("pk_block", 1);
_root.addSound("pk_block", 1);
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, _root.objects.pinkKnight.coord.x, _root.objects.pinkKnight.coord.y - 5, _root.objects.pinkKnight.coord.z - 20, "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = _root.objects.pinkKnight.dir;
_root.linkedObjects++;
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, _root.objects.pinkKnight.coord.x, _root.objects.pinkKnight.coord.y - 5, _root.objects.pinkKnight.coord.z - 20, "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = _root.objects.pinkKnight.dir;
_root.linkedObjects++;
_root.objects.pinkKnight.xSlide = (-_parent.dir) * 45;
_parent.gotoAndStop("idle");
} else {
_root.objects.pinkKnight.hit(30, _parent.dir, 5);
}
}
}
};
Symbol 462 MovieClip Frame 42
onEnterFrame = function () {
};
_parent.gotoAndStop("idle");
Symbol 477 MovieClip Frame 1
_root.shootDeflects = 0;
Symbol 477 MovieClip Frame 12
_parent.gotoAndStop("idle");
Symbol 486 MovieClip Frame 2
_root.addSound("ck_topspin" + Math.ceil((Math.random() * 1.9) + 0.1), 1);
Symbol 486 MovieClip Frame 10
_root.addSound("ck_topspin" + Math.ceil((Math.random() * 1.9) + 0.1), 1);
Symbol 489 MovieClip Frame 1
var loops = (Math.ceil(Math.random() * 8) + 6);
_root.shootDeflects = 0;
Symbol 489 MovieClip Frame 2
_parent.shoot(loops % 2, 1);
Symbol 489 MovieClip Frame 5
loops--;
if (loops <= 0) {
_parent.gotoAndStop("idle");
} else {
gotoAndPlay (2);
}
Symbol 491 MovieClip Frame 13
_parent.gotoAndStop("idle");
Symbol 514 MovieClip Frame 1
_root.addSound("ck_dizzystart", 1);
Symbol 514 MovieClip Frame 17
stop();
Symbol 514 MovieClip Frame 29
stop();
_parent.gotoAndStop("walk");
Symbol 586 MovieClip Frame 1
onEnterFrame = function () {
};
Symbol 586 MovieClip Frame 31
var spins = 0;
spins = Math.ceil(Math.random() * 3) + 1;
Symbol 586 MovieClip Frame 32
onEnterFrame = function () {
_parent.health = _parent.health + 10;
if (_parent.health > _parent.maxHealth) {
_parent.health = _parent.maxHealth;
}
};
Symbol 586 MovieClip Frame 63
spins--;
if (spins > 0) {
gotoAndPlay (32);
}
Symbol 586 MovieClip Frame 64
onEnterFrame = function () {
};
Symbol 586 MovieClip Frame 90
_parent.cranking = false;
_parent.gotoAndStop("idle");
Symbol 643 MovieClip Frame 18
_root.addBoundObject("minion", "minion" + _root.linkedObjects, 245, 60, 120, (_parent.coord.x + (110 * _parent.dir)) - Math.round(Math.random() * 10), _parent.coord.y, (_parent.coord.z - 15) - Math.round(Math.random() * 10), "minion", false, true);
_root.objects["shadow" + (_root.secondaryObjects - 1)].scaler = _root.objects["shadow" + (_root.secondaryObjects - 1)].scaler * 0.3;
_root.linkedObjects++;
_parent.minionCount++;
_parent.gotoAndStop("idle");
Symbol 652 MovieClip Frame 1
onEnterFrame = function () {
if (_root.pauseOn == 1) {
_parent.coord.x = _parent.coord.x + dashNum;
dashNum = dashNum - ((dashNum / Math.abs(dashNum)) * 3);
}
};
Symbol 652 MovieClip Frame 9
_root.addSound("ckThump", 1);
Symbol 652 MovieClip Frame 11
onEnterFrame = function () {
};
_parent.gotoAndStop("idle");
Symbol 661 MovieClip Frame 11
_parent.dir = _parent.dir * -1;
_parent.gotoAndStop("idle");
Symbol 662 MovieClip [cwKnight] Frame 1
#initclip 45
Object.registerClass("cwKnight", CWKnight);
#endinitclip
stop();
Symbol 662 MovieClip [cwKnight] Frame 2
stop();
Symbol 662 MovieClip [cwKnight] Frame 3
stop();
Symbol 662 MovieClip [cwKnight] Frame 4
stop();
Symbol 662 MovieClip [cwKnight] Frame 5
stop();
Symbol 662 MovieClip [cwKnight] Frame 6
stop();
Symbol 662 MovieClip [cwKnight] Frame 7
stop();
Symbol 662 MovieClip [cwKnight] Frame 8
stop();
Symbol 662 MovieClip [cwKnight] Frame 9
stop();
Symbol 662 MovieClip [cwKnight] Frame 10
stop();
Symbol 662 MovieClip [cwKnight] Frame 11
stop();
Symbol 662 MovieClip [cwKnight] Frame 12
stop();
Symbol 662 MovieClip [cwKnight] Frame 13
stop();
Symbol 662 MovieClip [cwKnight] Frame 14
stop();
Symbol 662 MovieClip [cwKnight] Frame 15
stop();
Symbol 687 MovieClip Frame 1
stop();
Symbol 693 MovieClip Frame 1
_parent.blockSpecial = 9;
Symbol 693 MovieClip Frame 3
stop();
Symbol 693 MovieClip Frame 7
_parent.gotoAndStop("idle");
Symbol 708 MovieClip Frame 9
stop();
Symbol 738 MovieClip Frame 1
var spins = 0;
Symbol 738 MovieClip Frame 3
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 738 MovieClip Frame 4
_parent.checkContactMade();
Symbol 738 MovieClip Frame 8
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(10);
};
Symbol 738 MovieClip Frame 9
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
onEnterFrame = function () {
};
Symbol 738 MovieClip Frame 11
_parent.checkContactMade();
Symbol 738 MovieClip Frame 13
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(17);
};
Symbol 738 MovieClip Frame 14
onEnterFrame = function () {
};
Symbol 738 MovieClip Frame 15
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 738 MovieClip Frame 19
_parent.checkContactMade();
Symbol 738 MovieClip Frame 24
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(20);
};
Symbol 738 MovieClip Frame 25
onEnterFrame = function () {
};
Symbol 738 MovieClip Frame 26
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 738 MovieClip Frame 31
_parent.checkContactMade();
Symbol 738 MovieClip Frame 38
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(16);
};
Symbol 738 MovieClip Frame 39
onEnterFrame = function () {
};
Symbol 738 MovieClip Frame 40
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 738 MovieClip Frame 43
_parent.checkContactMade();
Symbol 738 MovieClip Frame 47
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(10);
};
Symbol 738 MovieClip Frame 48
onEnterFrame = function () {
};
Symbol 738 MovieClip Frame 49
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 738 MovieClip Frame 53
spins++;
Symbol 738 MovieClip Frame 54
_parent.gravity = -11;
Symbol 738 MovieClip Frame 55
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 738 MovieClip Frame 57
_parent.checkContactMade();
Symbol 738 MovieClip Frame 59
stop();
_parent.timeSoFar = 10;
onEnterFrame = function () {
_parent.checkHitPress(0);
};
Symbol 738 MovieClip Frame 60
onEnterFrame = function () {
};
Symbol 738 MovieClip Frame 61
gotoAndPlay (53);
Symbol 741 MovieClip Frame 12
_parent.makeFootDust();
Symbol 741 MovieClip Frame 29
_parent.makeFootDust();
Symbol 756 MovieClip Frame 1
if ((_parent.dir == 1) && (Key.isDown(39))) {
_parent.xSlide = 15;
} else if ((_parent.dir == -1) && (Key.isDown(37))) {
_parent.xSlide = -15;
}
spins = 0;
Symbol 756 MovieClip Frame 3
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 756 MovieClip Frame 6
_parent.checkContactMade();
Symbol 756 MovieClip Frame 12
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(0);
};
Symbol 756 MovieClip Frame 13
onEnterFrame = function () {
};
Symbol 756 MovieClip Frame 15
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 756 MovieClip Frame 19
_parent.checkContactMade();
Symbol 756 MovieClip Frame 23
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(0);
};
Symbol 756 MovieClip Frame 24
onEnterFrame = function () {
};
Symbol 756 MovieClip Frame 26
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 756 MovieClip Frame 30
_parent.checkContactMade();
Symbol 756 MovieClip Frame 34
stop();
_parent.timeSoFar = _parent.timeAllowed - 3;
onEnterFrame = function () {
_parent.checkHitPress(0);
};
Symbol 756 MovieClip Frame 35
onEnterFrame = function () {
};
Symbol 756 MovieClip Frame 37
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 756 MovieClip Frame 40
_parent.checkContactMade();
Symbol 756 MovieClip Frame 43
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(0);
};
Symbol 756 MovieClip Frame 44
onEnterFrame = function () {
};
Symbol 756 MovieClip Frame 46
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 756 MovieClip Frame 48
_parent.checkContactMade();
Symbol 756 MovieClip Frame 51
stop();
_parent.timeSoFar = _parent.timeAllowed;
onEnterFrame = function () {
_parent.checkHitPress(0);
};
Symbol 756 MovieClip Frame 52
onEnterFrame = function () {
};
Symbol 756 MovieClip Frame 54
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 756 MovieClip Frame 59
_parent.checkContactMade();
Symbol 756 MovieClip Frame 62
stop();
_parent.timeSoFar = _parent.timeAllowed + 10;
onEnterFrame = function () {
_parent.checkHitPress(30);
};
Symbol 756 MovieClip Frame 63
onEnterFrame = function () {
};
Symbol 756 MovieClip Frame 68
spins++;
Symbol 756 MovieClip Frame 69
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
Symbol 756 MovieClip Frame 70
_parent.checkContactMade();
Symbol 756 MovieClip Frame 73
stop();
_parent.timeSoFar = 50 - (spins * 2);
onEnterFrame = function () {
_parent.checkHitPress(30);
};
Symbol 756 MovieClip Frame 74
_parent.attackMovingWait = _parent.attackMovingWait - 5;
onEnterFrame = function () {
};
gotoAndPlay (67);
Symbol 779 MovieClip Frame 1
onEnterFrame = function () {
_parent.xSlide = (-_parent.dir) * 12;
};
Symbol 779 MovieClip Frame 30
onEnterFrame = function () {
_parent.xSlide = (-_parent.dir) * 6;
};
Symbol 779 MovieClip Frame 41
onEnterFrame = function () {
_parent.xSlide = (-_parent.dir) * 5;
};
Symbol 779 MovieClip Frame 73
onEnterFrame = function () {
_parent.xSlide = (-_parent.dir) * 4;
};
Symbol 779 MovieClip Frame 95
onEnterFrame = function () {
_parent.xSlide = (-_parent.dir) * 2;
};
Symbol 779 MovieClip Frame 121
stop();
onEnterFrame = function () {
};
Symbol 780 MovieClip Frame 1
_parent.makeFootDust();
Symbol 780 MovieClip Frame 13
_parent.makeFootDust();
Symbol 785 MovieClip Frame 7
_root.addBoundObject("heart", "heart" + _root.linkedObjects, 50, 20, 50, _parent.coord.x, _parent.coord.y - 20, _parent.coord.z - 3, "heart", true);
_root.objects["heart" + _root.linkedObjects].dir = _parent.dir;
_root.objects["heart" + _root.linkedObjects].speed = 30;
_root.linkedObjects++;
_root.addBoundObject("kissSplat", "kissSplat" + _root.linkedObjects, 50, 50, 50, _parent.coord.x + (3 * _parent.dir), _parent.coord.y - 18, _parent.coord.z - 25, "kissSplat", true);
_root.objects["kissSplat" + _root.linkedObjects].pos = _parent.dir;
_root.linkedObjects++;
_root.addSound("goofy_kiss", 1);
Symbol 785 MovieClip Frame 10
_parent.gotoAndStop("idle");
Symbol 788 MovieClip Frame 7
_root.addBoundObject("heart", "heart" + _root.linkedObjects, 50, 20, 50, _parent.coord.x, _parent.coord.y - 20, _parent.coord.z - 3, "heart", true);
_root.objects["heart" + _root.linkedObjects].dir = _parent.dir;
_root.objects["heart" + _root.linkedObjects].speed = 30;
_root.linkedObjects++;
_root.addBoundObject("kissSplat", "kissSplat" + _root.linkedObjects, 50, 50, 50, _parent.coord.x + (3 * _parent.dir), _parent.coord.y - 18, _parent.coord.z - 25, "kissSplat", true);
_root.objects["kissSplat" + _root.linkedObjects].pos = _parent.dir;
_root.linkedObjects++;
_root.addSound("goofy_kiss", 1);
Symbol 788 MovieClip Frame 13
_parent.jumpAndStop();
Symbol 789 MovieClip Frame 1
stop();
Symbol 789 MovieClip Frame 6
_parent.jumpAndStop();
Symbol 830 MovieClip Frame 11
_parent.gotoAndStop("idle");
Symbol 831 MovieClip [pinkKnight] Frame 1
#initclip 46
Object.registerClass("pinkKnight", PinkKnight);
#endinitclip
stop();
Symbol 831 MovieClip [pinkKnight] Frame 2
stop();
Symbol 831 MovieClip [pinkKnight] Frame 3
stop();
Symbol 831 MovieClip [pinkKnight] Frame 4
stop();
Symbol 831 MovieClip [pinkKnight] Frame 5
stop();
Symbol 831 MovieClip [pinkKnight] Frame 6
stop();
Symbol 831 MovieClip [pinkKnight] Frame 7
stop();
Symbol 831 MovieClip [pinkKnight] Frame 8
stop();
Symbol 831 MovieClip [pinkKnight] Frame 9
stop();
Symbol 831 MovieClip [pinkKnight] Frame 10
stop();
Symbol 831 MovieClip [pinkKnight] Frame 11
stop();
Symbol 831 MovieClip [pinkKnight] Frame 12
stop();
Symbol 831 MovieClip [pinkKnight] Frame 13
stop();
Symbol 831 MovieClip [pinkKnight] Frame 14
stop();
Symbol 831 MovieClip [pinkKnight] Frame 15
stop();
Symbol 831 MovieClip [pinkKnight] Frame 16
stop();
Symbol 831 MovieClip [pinkKnight] Frame 17
stop();
Symbol 837 MovieClip [heart] Frame 1
#initclip 47
Object.registerClass("heart", Projectile);
#endinitclip
Symbol 838 MovieClip [streakHeart] Frame 16
this.removeMovieClip();
Symbol 840 MovieClip [cannonBall] Frame 1
#initclip 48
Object.registerClass("cannonBall", CannonBall);
#endinitclip
Symbol 842 MovieClip [shadow] Frame 1
#initclip 49
Object.registerClass("shadow", Shadow);
#endinitclip
Symbol 898 MovieClip Frame 1
stop();
Symbol 926 MovieClip Frame 1
stop();
Symbol 926 MovieClip Frame 2
stop();
Symbol 926 MovieClip Frame 3
stop();
Symbol 926 MovieClip Frame 4
stop();
Symbol 926 MovieClip Frame 5
stop();
Symbol 926 MovieClip Frame 6
stop();
Symbol 926 MovieClip Frame 7
stop();
Symbol 926 MovieClip Frame 8
stop();
Symbol 926 MovieClip Frame 9
stop();
Symbol 926 MovieClip Frame 10
stop();
Symbol 927 MovieClip [theHUD] Frame 1
#initclip 50
Object.registerClass("theHUD", TheHUD);
#endinitclip
Symbol 945 MovieClip Frame 30
stop();
Symbol 972 MovieClip [cannonBallGround] Frame 1
#initclip 51
Object.registerClass("cannonBallGround", Effect);
#endinitclip
Symbol 972 MovieClip [cannonBallGround] Frame 37
this.removeMovieClip();
Symbol 987 MovieClip Frame 23
stop();
Symbol 1008 MovieClip Frame 31
stop();
Symbol 1009 MovieClip [groundExplosion] Frame 1
#initclip 52
Object.registerClass("groundExplosion", Effect);
#endinitclip
Symbol 1009 MovieClip [groundExplosion] Frame 31
this.removeMovieClip();
Symbol 1040 MovieClip [levelUpAnim] Frame 1
#initclip 53
Object.registerClass("levelUpAnim", LevelUpAnim);
#endinitclip
Symbol 1040 MovieClip [levelUpAnim] Frame 50
this.swapDepths(5);
this.removeMovieClip();
Symbol 1056 MovieClip Frame 1
var endCombo = false;
Symbol 1056 MovieClip Frame 8
if (_parent.hitRange == null) {
_parent.hitRange = new ObjectProperties();
}
_parent.hitRange.coord.x = _parent.coord.x + (90 * _parent.dir);
_parent.hitRange.coord.y = _parent.coord.y;
_parent.hitRange.coord.z = _parent.coord.z;
_parent.hitRange.wide = 180;
_parent.hitRange.high = 30;
_parent.hitRange.long = 50;
if (_root.hitCheck(_root.objects.pinkKnight, _parent.hitRange)) {
if (_root.objects.pinkKnight.blocking && (_root.objects.pinkKnight.dir != _parent.dir)) {
_parent.xSlide = -25 * _parent.dir;
_parent.gotoAndStop("idle");
} else {
_root.objects.pinkKnight.minHit(-_parent.dir, 7, 5);
_root.addSound("minion_hits_PK", 1);
}
} else {
endCombo = true;
}
Symbol 1056 MovieClip Frame 14
if (endCombo) {
_parent.gotoAndStop("idle");
}
Symbol 1056 MovieClip Frame 24
if (_parent.hitRange == null) {
_parent.hitRange = new ObjectProperties();
}
_parent.hitRange.coord.x = _parent.coord.x + (90 * _parent.dir);
_parent.hitRange.coord.y = _parent.coord.y;
_parent.hitRange.coord.z = _parent.coord.z;
_parent.hitRange.wide = 180;
_parent.hitRange.high = 30;
_parent.hitRange.long = 50;
if (_root.hitCheck(_root.objects.pinkKnight, _parent.hitRange)) {
if (_root.objects.pinkKnight.blocking && (_root.objects.pinkKnight.dir != _parent.dir)) {
_parent.xSlide = -25 * _parent.dir;
_parent.gotoAndStop("idle");
} else {
_root.objects.pinkKnight.minHit(-_parent.dir, 7, 5);
_root.addSound("minion_hits_PK", 1);
}
} else {
endCombo = true;
}
Symbol 1056 MovieClip Frame 29
if (endCombo) {
_parent.gotoAndStop("idle");
}
Symbol 1056 MovieClip Frame 35
if (_parent.hitRange == null) {
_parent.hitRange = new ObjectProperties();
}
_parent.hitRange.coord.x = _parent.coord.x + (90 * _parent.dir);
_parent.hitRange.coord.y = _parent.coord.y;
_parent.hitRange.coord.z = _parent.coord.z;
_parent.hitRange.wide = 180;
_parent.hitRange.high = 30;
_parent.hitRange.long = 50;
if (_root.hitCheck(_root.objects.pinkKnight, _parent.hitRange)) {
if (_root.objects.pinkKnight.blocking && (_root.objects.pinkKnight.dir != _parent.dir)) {
_parent.xSlide = -25 * _parent.dir;
_parent.gotoAndStop("idle");
} else {
_root.objects.pinkKnight.minHit(-_parent.dir, 7, 15);
_root.addSound("minion_hits_PK", 1);
}
} else {
endCombo = true;
}
Symbol 1056 MovieClip Frame 40
_parent.gotoAndStop("idle");
Symbol 1059 MovieClip Frame 1
if (Math.random() > 0.5) {
gotoAndPlay ("hit2");
}
Symbol 1059 MovieClip Frame 8
_parent.gotoAndStop("idle");
Symbol 1059 MovieClip Frame 17
_root.objects.pinkKnight.coord.x;
Symbol 1076 MovieClip Frame 1
var timer = 300;
var i = 0;
i = 1;
while (i <= 9) {
this["part" + i].xSpeed = (Math.random() * 28) + 8;
this["part" + i].ySpeed = ((-Math.random()) * 22) - 9;
this["part" + i].rotSpeed = 10;
this["part" + i].swapDepths(100 - i);
this["part" + i].ridTime = (timer - (Math.random() * 100)) - 1;
i++;
}
onEnterFrame = function () {
if (_root.pauseOn == 1) {
timer--;
if (timer <= 0) {
_root.objects.cwKnight.minionCount--;
_parent.removeMovieClip();
}
i = 1;
while (i <= 9) {
this["part" + i].ridTime--;
if (this["part" + i].ridTime <= 0) {
this["part" + i]._alpha = this["part" + i]._alpha - 10;
if (this["part" + i]._alpha <= 0) {
this["part" + i].removeMovieClip();
}
}
this["part" + i]._x = this["part" + i]._x + this["part" + i].xSpeed;
this["part" + i]._y = this["part" + i]._y + this["part" + i].ySpeed;
this["part" + i]._rotation = this["part" + i]._rotation + ((this["part" + i].xSpeed * 5) + this["part" + i].rotSpeed);
this["part" + i].xSpeed = this["part" + i].xSpeed - ((0.4 * Math.abs(this["part" + i].xSpeed)) / this["part" + i].xSpeed);
this["part" + i].ySpeed = this["part" + i].ySpeed + 2;
if (this["part" + i]._y > 265) {
if (this["part" + i].ySpeed > 28) {
this["part" + i].ySpeed = this["part" + i].ySpeed * -0.8;
this["part" + i]._y = 264;
} else {
this["part" + i].xSpeed = (this["part" + i].ySpeed = (this["part" + i].rotSpeed = 0));
}
}
i++;
}
}
};
Symbol 1077 MovieClip [minion] Frame 1
#initclip 54
Object.registerClass("minion", Minion);
#endinitclip
stop();
Symbol 1077 MovieClip [minion] Frame 2
stop();
Symbol 1077 MovieClip [minion] Frame 3
stop();
Symbol 1077 MovieClip [minion] Frame 4
stop();
Symbol 1077 MovieClip [minion] Frame 5
stop();
Symbol 1079 MovieClip [spikeBomb] Frame 1
#initclip 55
Object.registerClass("spikeBomb", SpikeBomb);
#endinitclip
Symbol 1082 MovieClip [multiExplode] Frame 1
#initclip 56
Object.registerClass("multiExplode", Effect);
#endinitclip
Symbol 1082 MovieClip [multiExplode] Frame 25
this.removeMovieClip();
Symbol 1084 MovieClip [feathers] Frame 1
#initclip 57
Object.registerClass("feathers", Effect);
#endinitclip
Symbol 1084 MovieClip [feathers] Frame 111
this.removeMovieClip();
Symbol 1091 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 1097 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2006", "_blank");
}
Symbol 1100 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2007", "_blank");
}
Symbol 1103 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2008", "_blank");
}
Symbol 1106 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2009", "_blank");
}
Symbol 1112 Button
on (release) {
_root.play();
}
Instance of Symbol 1111 MovieClip in Symbol 1114 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("loaded");
}
}
onClipEvent (enterFrame) {
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("loaded");
}
}
Symbol 1114 MovieClip Frame 100
stop();
Symbol 1121 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 1124 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 1124 MovieClip Frame 10
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Symbol 1401 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 1402 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 1403 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.background = target.createEmptyMovieClip("background", 100);
target.background.beginFill(0);
target.background.moveTo(0, 0);
target.background.lineTo(300, 0);
target.background.lineTo(300, 250);
target.background.lineTo(0, 250);
target.background.lineTo(0, 0);
target.background.endFill();
target.mask = target.createEmptyMovieClip("mask", 101);
target.mask.beginFill(0);
target.mask.moveTo(0, 0);
target.mask.lineTo(300, 0);
target.mask.lineTo(300, 250);
target.mask.lineTo(0, 250);
target.mask.lineTo(0, 0);
target.mask.endFill();
target.clip = target.createEmptyMovieClip("clip", 102);
target.clip.ad = target.clip.createEmptyMovieClip("ad", 100);
target.clip.setMask(target.mask);
loadMovie (ad_swf_url, target.clip.ad);
callListener(events.AD_ATTACHED, true, null, target);
} else {
callListener(events.AD_ATTACHED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad"));
}
}
static function attachFlashAd(target) {
System.security.allowDomain("http://server.cpmstar.com");
System.security.allowDomain("http://www.cpmstar.com");
System.security.allowDomain("https://server.cpmstar.com");
System.security.allowDomain("https://www.cpmstar.com");
System.security.allowInsecureDomain("http://server.cpmstar.com");
System.security.allowInsecureDomain("http://www.cpmstar.com");
System.security.allowInsecureDomain("https://server.cpmstar.com");
System.security.allowInsecureDomain("https://www.cpmstar.com");
sendMessage("You may get a security sandbox violation from this ad. This is nothing to worry about!");
if (resetAdTimer()) {
if (ad_url) {
var _local1 = new LoadVars();
_local1.onData = function (data) {
if (data) {
com.Newgrounds.NewgroundsAPI.ad_swf_url = data;
} else {
com.Newgrounds.NewgroundsAPI.ad_swf_url = null;
}
com.Newgrounds.NewgroundsAPI.renderAd(target);
};
if (ad_url.indexOf("?") > -1) {
_local1.load((ad_url + "&random=") + Math.random());
} else {
_local1.load((ad_url + "?random=") + Math.random());
}
}
} else {
renderAd(target);
}
}
static function resetAdTimer() {
if (!ad_url) {
return(false);
}
var _local1 = new Date();
if (_local1.getTime() >= ad_reset) {
ad_reset = _local1.getTime() + 300000;
return(true);
}
return(false);
}
static function sendMessage(m, r) {
var _local1 = "[NewgroundsAPI] :: " + m;
if (r) {
return(_local1);
}
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 1404 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 1405 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 1406 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 1407 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 1408 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 1409 MovieClip [__Packages.ObjectProperties] Frame 0
class ObjectProperties
{
function ObjectProperties () {
}
var wide = 0;
var high = 0;
var long = 0;
var coord = {x:0, y:0, z:0};
}
Symbol 1410 MovieClip [__Packages.BoundObject] Frame 0
class BoundObject extends MovieClip
{
var cacheAsBitmap, _x, _y, _yscale, _xscale, swapDepths;
function BoundObject () {
super();
}
function setProperties(wid, het, dep, x, y, z, typ, anim) {
wide = wid;
high = het;
long = dep;
tag = typ;
coord = {x:x, y:y, z:z};
if (!anim) {
cacheAsBitmap = true;
}
}
function render() {
var _local2 = 800 / (coord.z + 600);
var _local4 = coord.x * _local2;
var _local3 = ((coord.y * _local2) * 5) - 700;
_x = coord.x;
_y = _local3;
_yscale = _local2 * 80;
_xscale = _yscale * dir;
swapDepths(Math.round(((99999999 - (coord.z * 50000)) - (coord.y * 300)) - (coord.x * 10)));
}
function act() {
render();
}
var dir = 1;
var wide = 0;
var high = 0;
var long = 0;
var tag = "";
var coord = {x:0, y:0, z:0};
var followShadow = null;
}
Symbol 1411 MovieClip [__Packages.ScoreNumber] Frame 0
class ScoreNumber extends BoundObject
{
var coord, removeMovieClip, _alpha, render, _xscale, _yscale;
function ScoreNumber () {
super();
}
function act() {
timer--;
coord.y = coord.y - 2;
if (timer == 29) {
_root.totalScore = _root.totalScore + worth;
}
if (timer < 0) {
removeMovieClip();
} else if (timer < 5) {
_alpha = _alpha - 20;
}
render();
_xscale = (_yscale = _yscale * 2.5);
}
var timer = 30;
var worth = 0;
}
Symbol 1412 MovieClip [__Packages.SmokePuff] Frame 0
class SmokePuff extends BoundObject
{
var coord, render, _xscale, _yscale;
function SmokePuff () {
super();
}
function act() {
coord.y = coord.y - 2;
render();
_xscale = (_yscale = _yscale * 1.5);
}
}
Symbol 1413 MovieClip [__Packages.BlackBirdFace] Frame 0
class BlackBirdFace extends BoundObject
{
var coord, removeMovieClip, render;
function BlackBirdFace () {
super();
}
function act() {
_root.birds = true;
if (!chase) {
sBomb._visible = false;
if (!lockBomb) {
snapSpeed = 10;
sBomb._visible = false;
targetX = _root.objects.pinkKnight.coord.x - (_root.objects.pinkKnight.dir * 160);
targetY = _root.objects.pinkKnight.coord.y - 23;
targetZ = _root.objects.pinkKnight.coord.z - 10;
} else {
snapSpeed = 8;
targetX = lockBombX + 5;
targetY = 195;
targetZ = lockBombZ - 6;
}
} else {
sBomb._visible = true;
_root.birdsBomb = true;
_root.birds = true;
targetX = _root.objects.pinkKnight.coord.x;
targetY = _root.objects.pinkKnight.coord.y - 23;
targetZ = _root.objects.pinkKnight.coord.z - 10;
snapSpeed = 13;
}
if (Math.abs(targetX - coord.x) > 10) {
coord.x = coord.x + ((targetX - coord.x) / snapSpeed);
if (targetX > coord.x) {
dir = 1;
} else {
dir = -1;
}
} else {
dir = _root.objects.pinkKnight.dir;
}
if (Math.abs(targetY - coord.y) > 10) {
coord.y = coord.y + ((targetY - coord.y) / snapSpeed);
}
if (Math.abs(targetZ - coord.z) > 10) {
coord.z = coord.z + ((targetZ - coord.z) / snapSpeed);
}
if (countDown > 0) {
countDown--;
} else if (countDown == 0) {
_root.addSound("explosion2", 1);
_root.addBoundObject("multiExplode", "cannonBallAir" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z - 3, "cannonBall", true, false);
_root.linkedObjects++;
_root.addBoundObject("feathers", "feathers" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z - 10, "feathers", true, false);
_root.linkedObjects++;
_root.birds = false;
_root.birdsBomb = false;
if (_root.hitCheck(_root.objects.pinkKnight, this)) {
_root.objects.pinkKnight.hit(30, coord.x - _root.objects.pinkKnight.coord.x, 5);
}
removeMovieClip();
}
render();
}
var targetX = 0;
var targetY = 0;
var targetZ = 0;
var snapSpeed = 10;
var dir = 1;
var lockBombX = 0;
var lockBombZ = 0;
var lockBomb = false;
var countDown = -1;
var sBomb = null;
var chase = false;
var timem = 10;
}
Symbol 1414 MovieClip [__Packages.Effect] Frame 0
class Effect extends BoundObject
{
var _visible, render, _xscale, _yscale;
function Effect () {
super();
_visible = false;
}
function act() {
_visible = true;
render();
_xscale = (_yscale = _yscale * 2.5);
_xscale = _xscale * pos;
}
var pos = 1;
}
Symbol 1415 MovieClip [__Packages.LevelUpAnim] Frame 0
class LevelUpAnim extends BoundObject
{
var coord, render;
function LevelUpAnim () {
super();
}
function act() {
coord.x = _root.objects.pinkKnight.coord.x;
coord.z = _root.objects.pinkKnight.coord.z - 5;
coord.y = _root.objects.pinkKnight.coord.y;
render();
}
}
Symbol 1416 MovieClip [__Packages.PinkFart] Frame 0
class PinkFart extends BoundObject
{
var render;
function PinkFart () {
super();
}
function act() {
if (!okDone) {
var _local3 = "";
for (_local3 in _root.objects) {
if (_root.hitCheck(this, _root.objects[_local3]) && (_root.objects[_local3].tag == "cwKnight")) {
_root.objects[_local3].hit(30);
okDone = true;
} else if (_root.hitCheck(this, _root.objects[_local3]) && (_root.objects[_local3].tag == "minion")) {
_root.objects[_local3].hit(50);
okDone = true;
}
}
}
render();
}
var okDone = false;
}
Symbol 1417 MovieClip [__Packages.StasisObject] Frame 0
class StasisObject extends BoundObject
{
var render, swapDepths;
function StasisObject () {
super();
}
function act() {
render();
swapDepths(99999);
}
}
Symbol 1418 MovieClip [__Packages.CWKnight] Frame 0
class CWKnight extends BoundObject
{
var gotoAndStop, coord, _xscale, render, _currentframe;
function CWKnight () {
super();
xAdditative = (600 * Math.round(Math.random())) - 300;
}
function act() {
if ((flashTimer == -1) && (levelUp == 5)) {
flashTimer = 6;
}
var _local3 = new flash.geom.ColorTransform();
if ((flashTimer <= 0) || (levelUp <= 4)) {
_local3.redOffset = 0;
_local3.greenOffset = 0;
_local3.blueOffset = 0;
if (flashTimer == 0) {
flashTimer = 6;
}
} else if (levelUp == 5) {
if (flashTimer <= 5) {
_local3.redOffset = 40;
_local3.greenOffset = 20;
_local3.blueOffset = 64;
}
flashTimer--;
} else if (levelUp < 5) {
flashTimer = -1;
}
whiteFlash--;
if (whiteFlash >= 0) {
_local3.redOffset = 160;
_local3.greenOffset = 160;
_local3.blueOffset = 160;
}
var _local4 = new flash.geom.Transform(this);
_local4.colorTransform = _local3;
levelProps();
smokePuffs();
if (!cranking) {
if (health < 0) {
health = 0;
if (exposedTimer <= 0) {
exposedTimer = 257;
spinDazeTimer = 0;
spinTimer = 0;
spinMoveCount = 0;
attackWait = 267;
moveWait = 262;
gotoAndStop("exposed");
}
}
if (exposedTimer > 0) {
health = health + 4;
if (exposedTimer == 15) {
knight.play();
}
}
exposedTimer--;
spinDazeTimer--;
attackWait--;
moveWait--;
xDistance = Math.abs(coord.x - _root.objects.pinkKnight.coord.x);
zDistance = Math.abs(coord.z - _root.objects.pinkKnight.coord.z);
totalDistance = xDistance + zDistance;
if (((spinTimer <= 0) && (spinDazeTimer <= 0)) && (exposedTimer <= 0)) {
if ((xTarget == 0) && (zTarget == 0)) {
setTarget(2);
}
if (moveable) {
moveCharacter();
}
decideAttack();
} else if ((spinTimer > 0) && (exposedTimer <= 0)) {
spin();
} else if ((exposedTimer <= 0) && (spinDazeTimer >= 0)) {
gotoAndStop("spindaze2");
}
}
_xscale = _xscale * dir;
render();
}
function moveCharacter() {
if ((moveWait <= 0) && (((!_currentframe) == 2) || (knight._currentframe > 6))) {
movement = false;
if ((coord.x - 8) > xTarget) {
coord.x = coord.x - xSpeed;
movement = true;
dir = -1;
}
if ((coord.x + 8) < xTarget) {
coord.x = coord.x + xSpeed;
movement = true;
dir = 1;
}
if ((coord.z + 8) < zTarget) {
coord.z = coord.z + zSpeed;
movement = true;
}
if ((coord.z - 8) > zTarget) {
coord.z = coord.z - zSpeed;
movement = true;
}
if (movement) {
gotoAndStop("walk");
} else {
gotoAndStop("idle");
}
setTarget(2);
}
}
function decideAttack() {
spinWaitTime--;
streamTimer--;
minionWait--;
if (((attackWait <= 0) && (_root.objects.pinkKnight.stamina > 0)) && (_root.objects.pinkKnight.dizzyMeter <= 0)) {
if (coord.x < _root.objects.pinkKnight.coord.x) {
dir = 1;
} else {
dir = -1;
}
if (((xDistance < 380) && (zDistance < 150)) && (xDistance > 150)) {
gotoAndStop("punch");
if (levelUp < 3) {
attackWait = 85;
} else {
attackWait = 55;
}
moveWait = 25;
} else if ((((levelUp == 5) && (Math.random() > 0.3)) && (streamTimer <= 0)) && (xDistance > 150)) {
if ((manHealth < (maxManHealth / 2)) && (Math.random() > 0.3)) {
gotoAndStop("shoot1");
streamTimer = 100 + Math.round(Math.random() * 50);
attackWait = 50;
moveWait = 20;
shootSpikeBomb();
} else {
gotoAndStop("shoot2");
streamTimer = 200 + Math.round(Math.random() * 100);
attackWait = 120;
moveWait = 70;
}
} else if ((((levelUp == 5) && (minionCount < 2)) && (Math.random() > 0.7)) && (minionWait <= 0)) {
gotoAndStop("dispatch");
attackWait = 40;
moveWait = 30;
minionWait = 250 + Math.round(Math.random() * 200);
} else if ((levelUp >= 4) && (spinWaitTime <= 0)) {
setTarget(3);
spinTimer = 150 + Math.round(Math.random() * 150);
attackWait = spinTimer + 50;
moveWait = spinTimer + 20;
if (levelUp != 5) {
spinMoveCount = 40;
} else {
spinMoveCount = 25;
}
spinWaitTime = 400 + Math.round(Math.random() * 300);
} else if (((levelUp >= 3) && (zDistance < 90)) && (xDistance > 150)) {
gotoAndStop("sawtoss");
attackWait = 120;
moveWait = 50;
_root.addSound("sawblade", 1);
} else if ((levelUp >= 2) && (xDistance > 150)) {
gotoAndStop("shoot1");
attackWait = 90;
moveWait = 30;
if ((manHealth < (maxManHealth / 2)) && (levelUp == 5)) {
shootSpikeBomb();
} else {
shoot(0, 0);
}
}
}
}
function setTarget(typ) {
if (typ == 1) {
xTarget = _root.leftBound + (Math.random() * (_root.rightBound - _root.leftBound));
zTarget = _root.lowerBound + (Math.random() * (_root.upperBound - _root.lowerBound));
} else if (typ == 2) {
if (Math.round(Math.random() * 150) == 1) {
xAdditative = (600 * Math.round(Math.random())) - 300;
}
xTarget = _root.objects.pinkKnight.coord.x + xAdditative;
zTarget = _root.objects.pinkKnight.coord.z + Math.round((Math.random() * 12) - 6);
} else if (typ == 3) {
if (coord.z > (_root.lowerBound + 50)) {
zTarget = _root.lowerBound;
} else {
zTarget = _root.upperBound;
}
if (dir == 1) {
xTarget = coord.x + 250;
if (xTarget > _root.rightBound) {
xTarget = _root.rightBound;
dir = -1;
}
} else {
xTarget = coord.x - 250;
if (xTarget < _root.leftBound) {
xTarget = _root.leftBound;
dir = 1;
}
}
angleOfRot = Math.atan2(coord.z - zTarget, coord.x - xTarget);
spinXSpeed = spinSpeed * Math.cos(angleOfRot);
spinZSpeed = spinSpeed * Math.sin(angleOfRot);
}
}
function shoot(num, sNum) {
_root.addBoundObject("cannonBall", "cannonBall" + _root.linkedObjects, 100, 10, 95, (coord.x + (70 * dir)) + ((330 * dir) * num), (coord.y - 115) - (5 * num), (coord.z - 15) - (50 * num), "cannonBall", false, true);
temp = _root.objects["cannonBall" + _root.linkedObjects];
temp.speed = (Math.abs(temp.coord.x - _root.objects.pinkKnight.coord.x) / 100) + 12;
if (sNum == 0) {
temp.xSpeed = (-(temp.coord.x - _root.objects.pinkKnight.coord.x)) / temp.speed;
temp.zSpeed = (-(temp.coord.z - _root.objects.pinkKnight.coord.z)) / temp.speed;
temp.ySpeed = (-(temp.coord.y - 190)) / temp.speed;
} else {
temp.xSpeed = (-(((temp.coord.x - _root.objects.pinkKnight.coord.x) + (Math.random() * 40)) - 20)) / temp.speed;
temp.zSpeed = (-(((temp.coord.z - _root.objects.pinkKnight.coord.z) + (Math.random() * 40)) - 20)) / temp.speed;
temp.ySpeed = (-(temp.coord.y - 190)) / temp.speed;
}
_root.addSound("GunCannon", 1);
_root.addSound("GunCannon", 1);
_root.linkedObjects++;
}
function shootSpikeBomb() {
_root.addSound("GunCannon", 1);
_root.addBoundObject("spikeBomb", "spikeBomb" + _root.linkedObjects, 100, 10, 95, (coord.x + (70 * dir)) + (330 * dir), coord.y - 75, coord.z - 15, "spikeBomb", false, true);
temp = _root.objects["spikeBomb" + _root.linkedObjects];
temp.speed = (Math.abs(temp.coord.x - _root.objects.pinkKnight.coord.x) / 100) + 12;
temp.xSpeed = (-(temp.coord.x - _root.objects.pinkKnight.coord.x)) / temp.speed;
temp.zSpeed = (-(temp.coord.z - _root.objects.pinkKnight.coord.z)) / temp.speed;
temp.ySpeed = (-(temp.coord.y - 190)) / temp.speed;
_root.linkedObjects++;
}
function spin() {
gotoAndStop("macespin");
spinTimer--;
spinMoveCount--;
if (spinMoveCount <= 0) {
if (_root.hitCheck(_root.objects.pinkKnight, this)) {
_root.objects.pinkKnight.hit(30, _root.objects.cwKnight.coord.x - _root.objects.pinkKnight.coord.x, 5);
}
coord.z = coord.z - (spinZSpeed * 1.2);
coord.x = coord.x - (spinXSpeed * 1.2);
}
if (((coord.x < xTarget) && (dir == -1)) || ((coord.x > xTarget) && (dir == 1))) {
if (spinTimer >= 2) {
setTarget(3);
}
}
}
function levelProps() {
if (health < (maxHealth / 5)) {
levelUp = 5;
_root.objects.pinkKnight.levelUp = 5;
} else if (health < ((maxHealth * 2) / 5)) {
levelUp = 4;
_root.objects.pinkKnight.levelUp = 4;
} else if (health < ((maxHealth * 3) / 5)) {
levelUp = 3;
_root.objects.pinkKnight.levelUp = 3;
} else if (health < ((maxHealth * 4) / 5)) {
levelUp = 2;
_root.objects.pinkKnight.levelUp = 2;
} else {
levelUp = 1;
_root.objects.pinkKnight.levelUp = 1;
}
if (levelUp == 1) {
xSpeed = 6;
zSpeed = 6;
} else if (levelUp == 2) {
xSpeed = 7;
zSpeed = 7;
} else if (levelUp == 3) {
xSpeed = 8;
zSpeed = 8;
} else if (levelUp == 4) {
xSpeed = 8;
zSpeed = 8;
} else {
xSpeed = 8;
zSpeed = 8;
}
}
function cannonHit() {
if (!cranking) {
_root.objects.hud.bossBar.sparks2.gotoAndPlay(2);
cannonHits--;
hit(20);
_root.addBoundObject("plus10", "plus10" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus10" + _root.linkedObjects].worth = 10;
_root.linkedObjects++;
if (cannonHits <= 0) {
if ((manHealth == 2500) && (!_root.unlocks[0])) {
_root.medal_popup.unlockMedal("TKO");
_root.unlocks[0] = true;
}
_root.addSound("CK_eletro_dizzy", 1);
gotoAndStop("2");
spinDazeTimer = 200;
attackWait = 220;
cannonHits = 3;
}
}
}
function hit(num) {
if (exposedTimer > 0) {
manHealth = manHealth - num;
_root.addSound("pilot_yelp" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
if (manHealth <= 0) {
if (((manHealth + num) > 0) && (num == 50)) {
_root.kissFinish = true;
}
_root.finalWin = true;
_root.flashTimer = 100;
}
if (num == 50) {
_root.addBoundObject("plus50", "plus50" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus50" + _root.linkedObjects].worth = 50;
_root.linkedObjects++;
} else if (num == 80) {
if (_root.objects.pinkKnight.gravityWait > 0) {
_root.addBoundObject("plus500", "plus500" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus500" + _root.linkedObjects].worth = 500;
_root.linkedObjects++;
} else {
_root.addBoundObject("plus100", "plus100" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus100" + _root.linkedObjects].worth = 100;
_root.linkedObjects++;
}
} else if (num == 150) {
if (_root.objects.pinkKnight.gravityWait > 0) {
_root.addBoundObject("plus1000", "plus1000" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus1000" + _root.linkedObjects].worth = 1000;
_root.linkedObjects++;
} else {
_root.addBoundObject("plus200", "plus200" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus200" + _root.linkedObjects].worth = 200;
_root.linkedObjects++;
}
} else if (num == 30) {
_root.addBoundObject("plus50", "plus50" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus50" + _root.linkedObjects].worth = 50;
_root.linkedObjects++;
}
} else {
_root.objects.hud.bossBar.sparks2.gotoAndPlay(2);
if (num == 50) {
_root.addBoundObject("plus5", "plus5" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus5" + _root.linkedObjects].worth = 5;
_root.linkedObjects++;
} else if (num == 80) {
if (_root.objects.pinkKnight.gravityWait > 0) {
_root.addBoundObject("plus50", "plus50" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus50" + _root.linkedObjects].worth = 50;
_root.linkedObjects++;
} else {
_root.addBoundObject("plus10", "plus10" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus10" + _root.linkedObjects].worth = 10;
_root.linkedObjects++;
}
} else if (num == 150) {
if (_root.objects.pinkKnight.gravityWait > 0) {
_root.addBoundObject("plus100", "plus100" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus100" + _root.linkedObjects].worth = 100;
_root.linkedObjects++;
} else {
_root.addBoundObject("plus20", "plus20" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus20" + _root.linkedObjects].worth = 20;
_root.linkedObjects++;
}
} else if (num == 30) {
_root.addBoundObject("plus10", "plus10" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 95, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus10" + _root.linkedObjects].worth = 10;
_root.linkedObjects++;
}
if (spinDazeTimer < 0) {
health = health - num;
} else {
health = health - (num * 1.4);
}
}
}
function rechargeNow() {
spinDazeTimer = 0;
spinTimer = 0;
spinMoveCount = 0;
gotoAndStop("crank");
cranking = true;
}
function dash(num) {
if ((((exposedTimer <= 0) && (spinDazeTimer <= 0)) && (!cranking)) && (spinTimer <= 0)) {
gotoAndStop("dash");
attackWait = 20 + Math.ceil(Math.random() * 10);
knight.dashNum = (num / Math.abs(num)) * 60;
}
}
function smokePuffs() {
if (smokeTimer < 0) {
smokeTimer = 4;
} else {
smokeTimer--;
}
}
var colorTrans = null;
var trans = null;
var flashTimer = -1;
var health = 7000;
var maxHealth = 7000;
var manHealth = 2500;
var maxManHealth = 2500;
var levelUp = 1;
var minionCount = 0;
var minionWait = 0;
var xSpeed = 6;
var zSpeed = 6;
var xTarget = 0;
var zTarget = 0;
var moveable = true;
var movement = false;
var dir = -1;
var knight = null;
var xDistance = 0;
var zDistance = 0;
var totalDistance = 0;
var attackWait = 0;
var moveWait = 0;
var xAdditative = 0;
var streamTimer = 0;
var spinWaitTime = 0;
var spinMoveCount = 0;
var spinTimer = 0;
var spinXSpeed = 0;
var spinZSpeed = 0;
var spinSpeed = 13;
var angleOfRot = 0;
var cannonHits = 3;
var spinDazeTimer = 0;
var cranking = false;
var exposedTimer = 0;
var whiteFlash = 0;
var smokeTimer = 8;
var pPoint = {x:0, y:0};
var temp = null;
var hitRange = null;
}
Symbol 1419 MovieClip [__Packages.PinkKnight] Frame 0
class PinkKnight extends BoundObject
{
var coord, _currentframe, gotoAndStop, render, swapDepths, getDepth, dir, wide, high, long;
function PinkKnight () {
super();
}
function act() {
if (checkLevel < levelUp) {
_root.addBoundObject("levelUpAnim", "levelUpAnim", 10, 10, 10, 1, 2, 3, "levelUpAnim", true, false);
_root.objects.cwKnight.spinWaitTime = 100 + Math.round(Math.random() * 50);
if ((levelUp != 5) && (levelUp != 2)) {
_root.camera.attachMovie("kLevelUp", "kLevelUp" + _root.linkedObjects, 9000 + _root.linkedObjects);
_root.camera["kLevelUp" + _root.linkedObjects]._x = -340;
_root.camera["kLevelUp" + _root.linkedObjects]._y = 180;
_root.linkedObjects++;
}
_root.addMusic("music" + levelUp, 9999);
_root.addSound("powerUPSound", 1);
} else if (checkLevel > levelUp) {
if ((levelUp != 1) && (levelUp != 4)) {
_root.camera.attachMovie("kLevelDown", "kLevelDown" + _root.linkedObjects, 1000 + _root.linkedObjects);
_root.camera["kLevelDown" + _root.linkedObjects]._x = -310;
_root.camera["kLevelDown" + _root.linkedObjects]._y = 180;
_root.linkedObjects++;
}
_root.addBoundObject("levelDown", "levelDown", 10, 10, 10, 1, 2, 3, "levelDownAnim", true, false);
_root.addMusic("music" + levelUp, 9999);
_root.addSound("levelDOWNSound", 1);
}
checkLevel = levelUp;
moving();
if (bounces == 0) {
checkDizzy();
}
if ((health > 0) && (dizzyMeter <= 0)) {
blockSpecial--;
hitWait--;
specialAttackTimer--;
jumping();
checkBlock();
checkAttack();
checkProjectile();
if ((((((((gravity == 0) && (coord.y == 210)) && (jumpPause <= 3)) && (!blocking)) && ((attackMovingWait <= 0) || (coord.y < 210))) && (!nonMoveable)) && (dizzyMeter <= 0)) && (_currentframe != 17)) {
if (xMovement || (yMovement)) {
if (doubleTapped) {
gotoAndStop("sprint");
} else {
gotoAndStop("run");
}
} else {
gotoAndStop("idle");
}
}
} else if (health <= 0) {
deathTimer--;
if (deathTimer <= 0) {
_root.gotoAndStop("gameOverScreen");
}
}
render();
swapDepths(getDepth() + 500000);
}
function moving() {
if ((health > 0) && (dizzyMeter <= 0)) {
xMovement = false;
yMovement = false;
if (doubleTapWait > 0) {
doubleTapWait--;
}
if (!Key.isDown(37)) {
tapUpLeft = true;
}
if (!Key.isDown(39)) {
tapUpRight = true;
}
if (((((attackMovingWait <= 0) || (coord.y < 210)) && (!blocking)) && (projectileWait <= 0)) && (blockWait <= 0)) {
if (((coord.y != 210) || (jumpPause <= 0)) && (!nonMoveable)) {
if (((coord.x < ((_root.rightBound - xSpeed) - addSlides(xSlide, slideXRatio))) && (Key.isDown(39))) && (!Key.isDown(37))) {
if (dir == -1) {
doubleTapWait = 0;
}
if (!doubleTapped) {
if (((doubleTapWait > 10) && (tapUpRight)) && (levelUp >= 1)) {
doubleTapped = true;
}
}
if (tapUpRight) {
tapUpRight = false;
doubleTapWait = doubleTapWait + 20;
}
dir = 1;
xSlide = 15 + (doubleTapped * 9);
xMovement = true;
coord.x = coord.x + (xSpeed + (doubleTapped * 9));
}
if (((coord.x > ((_root.leftBound - xSpeed) - addSlides(xSlide, slideXRatio))) && (Key.isDown(37))) && (!Key.isDown(39))) {
if (dir == 1) {
doubleTapWait = 0;
}
if (!doubleTapped) {
if (((doubleTapWait > 10) && (tapUpLeft)) && (levelUp >= 1)) {
doubleTapped = true;
}
}
if (tapUpLeft) {
tapUpLeft = false;
doubleTapWait = doubleTapWait + 20;
}
dir = -1;
xSlide = -15 - (doubleTapped * 9);
xMovement = true;
coord.x = coord.x - (xSpeed + (doubleTapped * 9));
}
}
if (((coord.y == 210) && (!nonMoveable)) || (bounces > 0)) {
if (((coord.z < ((_root.upperBound - zSpeed) - addSlides(zSlide, slideZRatio))) && (Key.isDown(38))) && (!Key.isDown(40))) {
zSlide = 7;
yMovement = true;
coord.z = coord.z + zSpeed;
}
if (((coord.z > ((_root.lowerBound - zSpeed) - addSlides(zSlide, slideZRatio))) && (Key.isDown(40))) && (!Key.isDown(38))) {
zSlide = -7;
yMovement = true;
coord.z = coord.z - zSpeed;
}
}
}
}
if (((!xMovement) || (nonMoveable)) || (health <= 0)) {
doubleTapped = false;
if ((bounces > 0) && ((((coord.x + xSlide) > _root.rightBound) && (xSlide > 0)) || (((coord.x + xSlide) < _root.leftBound) && (xSlide < 0)))) {
xSlide = xSlide * -0.7;
dir = dir * -1;
if (dir == 1) {
coord.x = _root.rightBound - 5;
} else {
coord.x = _root.leftBound + 5;
}
}
if (((coord.x + xSlide) < _root.rightBound) && ((coord.x + xSlide) > _root.leftBound)) {
coord.x = coord.x + xSlide;
}
if (Math.abs(xSlide) > 1.5) {
if (bounces == 0) {
xSlide = xSlide + (((-xSlide) * slideXRatio) / Math.abs(xSlide));
} else {
xSlide = xSlide + ((((-xSlide) * slideXRatio) / Math.abs(xSlide)) * 0.2);
}
} else {
xSlide = 0;
}
}
if (!yMovement) {
coord.z = coord.z + zSlide;
if (Math.abs(zSlide) > 1.5) {
zSlide = zSlide + (((-zSlide) * slideZRatio) / Math.abs(zSlide));
} else {
zSlide = 0;
}
}
}
function jumping() {
gravityWait--;
sGravityWait--;
if ((gravityWait <= 0) || (gravity < 0)) {
coord.y = coord.y + (gravity * 0.7);
}
if (((gravity != 0) && (coord.y >= 210)) && (bounces <= 0)) {
_root.addSound("pkThump", 1);
if (Math.abs(coord.x - _root.objects.cwKnight.coord.x) < 400) {
_root.objects.cwKnight.dash(_root.objects.cwKnight.coord.x - coord.x);
}
}
if (((coord.y > 210) && (attackMovingWait > 0)) && (bounces <= 0)) {
attackMovingWait = 0;
gotoAndStop("idle");
}
if (coord.y >= 210) {
if (bounces > 0) {
gravity = -4.5 * bounces;
coord.y = coord.y + (gravity * 0.7);
bounces--;
if ((Math.random() > 0.6) && (bounces >= 2)) {
gotoAndStop("tumble");
}
if (bounces == 0) {
comboed = 0;
nonMoveable = false;
coord.y = 210;
gravity = 0;
}
} else {
coord.y = 210;
gravity = 0;
}
} else {
if ((gravityWait <= 0) || (knight.spins > 0)) {
if ((sGravityWait <= 0) || (gravity < 0)) {
gravity = gravity + 1.5;
} else {
gravity = gravity + 0.03;
}
}
if (((inJump && (gravity > 0)) && (coord.y > 180)) && (_currentframe != 4)) {
knight.play();
inJump = false;
}
}
jumpPause--;
if (((((((coord.y == 210) && (gravity == 0)) && (jumpPause <= 0)) && (Key.isDown(68))) && (attackMovingWait <= 0)) && (projectileWait <= 0)) && (bounces == 0)) {
doubleTapped = false;
doubleJumped = false;
gravity = -16;
coord.y--;
inJump = true;
jumpPause = 31;
_root.addSound("pk_swing" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
gotoAndStop("jump");
}
doubleJumpTimer--;
if (((coord.y != 210) && (!doubleJumped)) && (bounces == 0)) {
if (!Key.isDown(68)) {
doubleJumpTimer = 10;
} else if (((doubleJumpTimer > 0) && (gravity > -6)) && (gravity < 6)) {
doubleJumped = true;
gotoAndStop("doubleJump");
if (levelUp >= 4) {
_root.addBoundObject("pinkFart", "pinkFart" + _root.linkedObjects, 70, 200, 60, coord.x, 211, coord.z - 4, "pinkFart", true, false);
_root.linkedObjects++;
_root.addSound("fart" + Math.ceil((Math.random() * 3.9) + 0.1), 1);
}
gravity = -12;
}
}
}
function addSlides(num, ratio) {
if (Math.abs(num) > 1.5) {
num = num + addSlides(num + (((-num) * ratio) / Math.abs(num)), ratio);
}
return(num);
}
function checkContactMade() {
if (hitRange == null) {
hitRange = new ObjectProperties();
}
hitRange.coord.x = coord.x + (70 * dir);
hitRange.coord.y = coord.y - 35;
hitRange.coord.z = coord.z;
hitRange.wide = wide + 30;
hitRange.high = high;
hitRange.long = long;
var _local3 = "";
for (_local3 in _root.objects) {
if (_root.hitCheck(hitRange, _root.objects[_local3]) && ((_root.objects[_local3].tag == "cwKnight") || ((_root.objects[_local3].tag == "minion") && (_root.objects[_local3].health > 0)))) {
if ((_root.objects.cwKnight.exposedTimer <= 0) || (coord.y < 165)) {
contactMade = true;
if (knight.spins > 1) {
_root.objects[_local3].hit(150);
if (knight.spins == 6) {
if (coord.y != 210) {
if (!_root.unlocks[6]) {
_root.medal_popup.unlockMedal("MaryPoppinz");
_root.unlocks[6] = true;
}
} else if (!_root.unlocks[5]) {
_root.medal_popup.unlockMedal("DreidelPower");
_root.unlocks[5] = true;
}
}
} else {
_root.objects[_local3].hit(80);
}
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, hitRange.coord.x - Math.round((Math.random() * 10) - 5), hitRange.coord.y - Math.round((Math.random() * 10) - 5), (hitRange.coord.z - 25) - Math.round(Math.random() * 20), "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = dir;
_root.objects["hitsparkz" + _root.linkedObjects]._rotation = _root.objects["hitsparkz" + _root.linkedObjects]._rotation - (Math.random() * 90);
_root.linkedObjects++;
_root.addSound("pk_hit_ck" + Math.ceil((Math.random() * 2.9) + 0.1), 1);
if (gravityWait > 0) {
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, hitRange.coord.x - Math.round((Math.random() * 10) - 5), hitRange.coord.y - Math.round((Math.random() * 10) - 5), (hitRange.coord.z - 25) - Math.round(Math.random() * 20), "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = dir;
_root.objects["hitsparkz" + _root.linkedObjects]._rotation = _root.objects["hitsparkz" + _root.linkedObjects]._rotation - (Math.random() * 90);
_root.linkedObjects++;
}
specialAttackTimer = 8;
}
}
}
}
function checkHitPress(inc) {
if (_root.pauseOn == 1) {
timeSoFar--;
if (!Key.isDown(65)) {
buttonReleased = true;
}
if ((contactMade && (Key.isDown(65))) && (buttonReleased)) {
knight.play();
buttonReleased = false;
attackMovingWait = attackMovingWait + 13;
contactMade = false;
sGravityWait = inc;
if ((specialAttackTimer > 0) && (coord.y < 210)) {
_root.objects.cwKnight.whiteFlash = 2;
gravityWait = 10;
}
}
if (timeSoFar <= 0) {
if (coord.y == 210) {
gotoAndStop("idle");
} else {
gotoAndStop("jump");
knight.gotoAndStop(9);
}
}
}
}
function checkAttack() {
attackMovingWait--;
if (((Key.isDown(65) && (attackMovingWait <= 0)) && (projectileWait <= 0)) && (bounces == 0)) {
contactMade = false;
if (coord.y == 210) {
gotoAndStop("attackA");
} else {
gotoAndStop("airAttackA");
sGravityWait = 15;
}
attackMovingWait = 20;
}
}
function checkBlock() {
blockWait--;
if ((!blocking) && (Key.isDown(83))) {
blockWait = 7;
}
if ((Key.isDown(83) && (projectileWait <= 0)) && (bounces == 0)) {
blocking = true;
if (coord.y == 210) {
gotoAndStop("groundBlock");
} else {
gotoAndStop("airBlock");
}
} else {
if (blocking) {
knight.play();
}
blocking = false;
}
}
function checkProjectile() {
projectilePause--;
projectileWait--;
if ((((Key.isDown(65) && (Key.isDown(83))) && (projectilePause <= 0)) && (bounces == 0)) && (levelUp >= 3)) {
if (levelUp == 3) {
projectilePause = 20;
projectileWait = 10;
} else {
projectilePause = 13;
projectileWait = 7;
}
if (coord.y == 210) {
gotoAndStop("groundProjectile");
knight.gotoAndPlay(1);
} else {
gotoAndStop("airProjectile");
}
}
}
function hit(sli, di, hea) {
if ((((hitWait <= 0) && (health > 0)) && (dizzyMeter <= 0)) && (invincibleTimer <= 0)) {
_root.addSound("hit_from_ck", 1);
comboed++;
health = health - hea;
_root.shakeDuration = 6;
_root.shakeStrength = 10;
dir = di / Math.abs(di);
if (health <= 0) {
gotoAndStop("death");
deathTimer = 200;
coord.y = 210;
gravity = 0;
} else {
if (coord.y == 210) {
gotoAndStop("groundHit");
} else {
gotoAndStop("airHit");
}
nonMoveable = true;
if (comboed > 2) {
xSlide = (((-sli) * di) / Math.abs(di)) * 2;
} else {
xSlide = ((-sli) * di) / Math.abs(di);
}
gravity = -18;
gravityWait = 0;
sGravityWait = 0;
bounces = 3;
hitWait = 50;
stamina = stamina - 30;
if (stamina < 0) {
stamina = 0;
}
}
}
}
function minHit(di, hea, sli) {
if ((((hitWait <= 0) && (health > 0)) && (dizzyMeter <= 0)) && (invincibleTimer <= 0)) {
health = health - hea;
_root.shakeDuration = 2;
_root.shakeStrength = 4;
dir = di / Math.abs(di);
if (health <= 0) {
gotoAndStop("death");
coord.y = 210;
gravity = 0;
} else {
gotoAndStop("gHit");
xSlide = ((-sli) * di) / Math.abs(di);
blockWait = 10;
stamina = stamina - 5;
if (stamina < 0) {
stamina = 0;
}
}
}
}
function checkDizzy() {
if (stamina < 120) {
if (stamina <= 0) {
stamina = 1;
dizzyMeter = 150;
_root.totalDizzies++;
_root.objects.cwKnight.rechargeNow();
_root.camera.attachMovie("dizzyRecoveryMash", "dizzyRecoveryMash", 8489343);
_root.camera.dizzyRecoveryMash._x = 180;
_root.camera.dizzyRecoveryMash._y = -145;
}
stamina = stamina + 0.15;
}
if (dizzyMeter > 0) {
dizzyMeter--;
if (((!Key.isDown(83)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
notMashin = true;
}
if (((Key.isDown(83) || (Key.isDown(65))) || (Key.isDown(68))) && (notMashin)) {
dizzyMeter = dizzyMeter - 4;
notMashin = false;
}
stamina = 120 - (dizzyMeter * 0.8);
if (stamina < 0) {
stamina = 0;
}
gotoAndStop("dizzy");
if ((dizzyMeter % 10) == 0) {
_root.addBoundObject("minusNumber", "minusNumber" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 35, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
if (_root.totalDizzies > 9) {
_root.totalDizzies = 9;
}
_root.objects["minusNumber" + _root.linkedObjects].worth = -10 * _root.totalDizzies;
_root.objects["minusNumber" + _root.linkedObjects].numba.gotoAndStop(_root.totalDizzies + 1);
_root.linkedObjects++;
}
}
}
function jumpAndStop() {
gotoAndStop("jump");
knight.gotoAndPlay(9);
}
function makeFootDust() {
_root.addBoundObject("footDust", "footDust" + _root.linkedObjects, 50, 100, 40, coord.x, 212, coord.z - 4, "footDust", true, false);
_root.objects["footDust" + _root.linkedObjects].pos = -dir;
_root.linkedObjects++;
}
var deathTimer = -1;
var levelUp = 1;
var checkLevel = 1;
var levelUpAnim = null;
var invincibleTimer = 0;
var knight = null;
var maxHealth = 400;
var health = 400;
var stamina = 120;
var dizzyMeter = 0;
var xSpeed = 14;
var zSpeed = 8;
var xSlide = 0;
var zSlide = 0;
var slideXRatio = 2.3;
var slideZRatio = 1.7;
var doubleTapWait = 0;
var tapUpRight = false;
var tapUpLeft = false;
var doubleTapped = false;
var xMovement = false;
var yMovement = false;
var nonMoveable = false;
var gravity = 0;
var jumpPause = 0;
var inJump = false;
var doubleJumped = false;
var doubleJumpTimer = 0;
var bounces = 0;
var attackMovingWait = 0;
var contactMade = true;
var timeAllowed = 15;
var timeSoFar = 0;
var buttonReleased = false;
var gravityWait = 0;
var sGravityWait = 0;
var specialAttackTimer = 0;
var notMashin = false;
var projectileWait = 0;
var projectilePause = 0;
var blocking = false;
var blockWait = 0;
var blockSpecial = 0;
var comboed = 0;
var hitRange = null;
var it = "";
var hitWait = 0;
}
Symbol 1420 MovieClip [__Packages.Projectile] Frame 0
class Projectile extends BoundObject
{
var coord, attachMovie, _x, removeMovieClip, render;
function Projectile () {
super();
}
function act() {
original.swapDepths(9999);
coord.x = coord.x + (speed * dir);
countDown--;
if (countDown <= 0) {
countDown = 3;
attachMovie("streakHeart", "heart" + objects, objects);
this["heart" + objects]._rotation = (-90 + (Math.random() * 34)) - 17;
objects++;
}
if ((_x > 1500) || (_x < -1650)) {
removeMovieClip();
}
checkContactMade();
render();
}
function checkContactMade() {
var _local3 = "";
for (_local3 in _root.objects) {
if (_root.hitCheck(this, _root.objects[_local3]) && (((_root.objects[_local3].tag == "cwKnight") && ((_root.objects.cwKnight.exposedTimer <= 0) || (coord.y < 165))) || ((_root.objects[_local3].tag == "minion") && (_root.objects[_local3].health > 0)))) {
_root.addBoundObject("projectileHit", "projectileHit" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y, (coord.z - 20) - Math.round(Math.random() * 10), "projectileHit", true, false);
_root.objects["projectileHit" + _root.linkedObjects].pos = dir;
_root.linkedObjects++;
_root.addSound("kisssplat" + Math.ceil(Math.random() * 1.9), 1);
if (_root.objects[_local3].tag == "cwKnight") {
_root.objects[_local3].hit(50);
} else {
_root.objects[_local3].hit(80);
}
removeMovieClip();
}
}
}
var dir = 0;
var speed = 0;
var objects = 1;
var countDown = 2;
var original = null;
}
Symbol 1421 MovieClip [__Packages.CannonBall] Frame 0
class CannonBall extends BoundObject
{
var coord, removeMovieClip, render;
function CannonBall () {
super();
}
function act() {
coord.x = coord.x + xSpeed;
coord.y = coord.y + ySpeed;
coord.z = coord.z + zSpeed;
if (coord.y > 200) {
_root.addSound("explosion1", 1);
_root.addBoundObject("cannonBallGround", "cannonBallGround" + _root.linkedObjects, 50, 50, 40, coord.x, 215, coord.z + 2, "cannonBall", true, false);
_root.objects["cannonBallGround" + _root.linkedObjects].pos = xSpeed / Math.abs(xSpeed);
_root.linkedObjects++;
removeMovieClip();
} else if (coord.y < -400) {
removeMovieClip();
}
if (_root.hitCheck(_root.objects.pinkKnight, this) && (!reversed)) {
if (_root.objects.pinkKnight.blocking && (((_root.objects.pinkKnight.dir == 1) && (xSpeed < 0)) || ((_root.objects.pinkKnight.dir == -1) && (xSpeed > 0)))) {
_root.addSound("pk_block", 1);
if (_root.objects.pinkKnight.blockSpecial > 0) {
_root.shootDeflects++;
if (_root.shootDeflects > 2) {
if (!_root.unlocks[7]) {
_root.medal_popup.unlockMedal("PlaywithMyBalls");
_root.unlocks[7] = true;
}
}
specialBlock = true;
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 5, coord.z - 20, "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = _root.objects.pinkKnight.dir;
_root.linkedObjects++;
xSpeed = xSpeed * -2;
zSpeed = zSpeed * -2;
ySpeed = ySpeed * -2;
} else {
xSpeed = xSpeed * (-((Math.random() * 1.5) + 1.5));
zSpeed = zSpeed * (-((Math.random() * 1.5) + 1.5));
ySpeed = -15 - (Math.random() * 8);
}
reversed = true;
} else {
_root.addSound("explosion2", 1);
_root.objects.pinkKnight.hit(30, _root.objects.cwKnight.coord.x - _root.objects.pinkKnight.coord.x, 5);
_root.addBoundObject("cannonBallAir", "cannonBallAir" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z - 3, "cannonBall", true, false);
_root.objects["cannonBallAir" + _root.linkedObjects].pos = xSpeed / Math.abs(xSpeed);
_root.linkedObjects++;
removeMovieClip();
}
} else if ((reversed && (specialBlock)) && (_root.hitCheck(_root.objects.cwKnight, this))) {
_root.addSound("explosion2", 1);
_root.objects.cwKnight.cannonHit();
_root.addBoundObject("cannonBallAir", "cannonBallAir" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z - 3, "cannonBall", true, false);
_root.objects["cannonBallAir" + _root.linkedObjects].pos = xSpeed / Math.abs(xSpeed);
_root.linkedObjects++;
removeMovieClip();
}
render();
}
var xSpeed = 0;
var zSpeed = 0;
var ySpeed = 0;
var speed = 0;
var reversed = false;
var specialBlock = false;
}
Symbol 1422 MovieClip [__Packages.Shadow] Frame 0
class Shadow extends BoundObject
{
var coord, removeMovieClip, render, _xscale, _yscale;
function Shadow () {
super();
}
function act() {
coord.x = shadowTarget.coord.x;
coord.z = shadowTarget.coord.z + 5;
coord.y = 212;
if (shadowTarget.coord.x == undefined) {
removeMovieClip();
}
render();
_xscale = scaler * 3;
_yscale = scaler * 2;
}
var shadowTarget = null;
var scaler = 0;
}
Symbol 1423 MovieClip [__Packages.TheHUD] Frame 0
class TheHUD extends MovieClip
{
var _x, _parent, _y;
function TheHUD () {
super();
}
function act() {
_x = (_root.camera._x - _parent._x) - 850;
_y = (_root.camera._y - _parent._y) - 320;
}
}
Symbol 1424 MovieClip [__Packages.Minion] Frame 0
class Minion extends BoundObject
{
var render, coord, _xscale, gotoAndStop;
function Minion () {
super();
xSpeed = (7 + (Math.random() * 4)) - 2;
zSpeed = (4 + (Math.random() * 2)) - 1;
}
function act() {
if (health > 0) {
attackWait--;
moveWait--;
if ((moveWait <= 0) || (xSlide != 0)) {
moveCharacter();
}
if (attackWait <= 0) {
decideAttack();
}
}
render();
}
function moveCharacter() {
movement = false;
xTarget = _root.objects.pinkKnight.coord.x;
zTarget = _root.objects.pinkKnight.coord.z;
if (xSlide == 0) {
if ((coord.x - 140) > xTarget) {
coord.x = coord.x - xSpeed;
movement = true;
dir = -1;
}
if ((coord.x + 140) < xTarget) {
coord.x = coord.x + xSpeed;
movement = true;
dir = 1;
}
_xscale = _xscale * dir;
if ((coord.z + 5) < zTarget) {
coord.z = coord.z + zSpeed;
movement = true;
}
if ((coord.z - 5) > zTarget) {
coord.z = coord.z - zSpeed;
movement = true;
}
} else {
coord.x = coord.x + xSlide;
xSlide = xSlide - (xSlide / Math.abs(xSlide));
if (Math.abs(xSlide) < 1) {
xSlide = 0;
}
}
if (movement) {
gotoAndStop("walk");
} else {
gotoAndStop("idle");
}
}
function decideAttack() {
if (coord.x < _root.objects.pinkKnight.coord.x) {
dir = 1;
} else {
dir = -1;
}
if ((((_root.objects.dizzyMeter <= 0) && (Math.abs(coord.x - _root.objects.pinkKnight.coord.x) < 200)) && (Math.abs(coord.z - _root.objects.pinkKnight.coord.z) < 50)) && (_root.objects.pinkKnight.dizzyMeter <= 0)) {
gotoAndStop("attack");
attackWait = 70;
moveWait = 40;
}
}
function hit(num) {
if (health > 0) {
xSlide = _root.objects.pinkKnight.dir * 15;
health = health - num;
gotoAndStop("hit");
attackWait = 12;
if (health <= 0) {
if (num == 50) {
_root.minionFartDeaths++;
if (_root.minionFartDeaths == 3) {
_root.medal_popup.unlockMedal("OneBigClusterFart");
}
}
_root.addSound("minion_pieces", 1);
gotoAndStop("death");
_root.addBoundObject("multiExplode", "cannonBallAir" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z + 10, "cannonBall", true, false);
followShadow.removeMovieClip();
} else {
_root.addSound("minion_hit", 1);
}
_root.addBoundObject("plus5", "plus5" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 30, (coord.z + 40) - Math.round(Math.random() * 10), "plus", true, false);
_root.objects["plus5" + _root.linkedObjects].worth = 5;
_root.linkedObjects++;
}
}
var health = 190;
var xSpeed = 7;
var zSpeed = 4;
var dir = 1;
var knight = null;
var xTarget = 0;
var zTarget = 0;
var movement = false;
var xSlide = 0;
var moveWait = 0;
var attackWait = 0;
var hitRange = null;
var followShadow = null;
}
Symbol 1425 MovieClip [__Packages.SpikeBomb] Frame 0
class SpikeBomb extends BoundObject
{
var coord, removeMovieClip, render;
function SpikeBomb () {
super();
}
function act() {
coord.x = coord.x + xSpeed;
coord.y = coord.y + ySpeed;
coord.z = coord.z + zSpeed;
if (!bounced) {
if (_root.hitCheck(_root.objects.pinkKnight, this) && (!reversed)) {
if (_root.objects.pinkKnight.blocking && (((_root.objects.pinkKnight.dir == 1) && (xSpeed < 0)) || ((_root.objects.pinkKnight.dir == -1) && (xSpeed > 0)))) {
_root.addSound("pk_block", 1);
if (_root.objects.pinkKnight.blockSpecial > 0) {
specialBlock = true;
_root.addBoundObject("hitsparkz", "hitsparkz" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 5, coord.z - 20, "hitsparkz", true, false);
_root.objects["hitsparkz" + _root.linkedObjects].pos = _root.objects.pinkKnight.dir;
_root.linkedObjects++;
xSpeed = xSpeed * -1.3;
zSpeed = zSpeed * -1.3;
ySpeed = ySpeed * -1.3;
_root.objects.cwKnight.moveWait = 60;
_root.objects.cwKnight.attackWait = 70;
volley++;
} else {
_root.addSound("explosion2", 1);
_root.objects.pinkKnight.hit(30, _root.objects.cwKnight.coord.x - _root.objects.pinkKnight.coord.x, 5);
_root.addBoundObject("cannonBallAir", "cannonBallAir" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z - 3, "cannonBall", true, false);
_root.objects["cannonBallAir" + _root.linkedObjects].pos = xSpeed / Math.abs(xSpeed);
_root.linkedObjects++;
if (!_root.birds) {
_root.addBoundObject("blackBirdFace", "blackBirdFace", 450, 300, 200, coord.x, coord.y - 15, coord.z - 8, "blackBirdFace", true, false);
_root.linkedObjects++;
}
removeMovieClip();
}
reversed = true;
} else {
_root.addSound("explosion2", 1);
_root.objects.pinkKnight.hit(30, _root.objects.cwKnight.coord.x - _root.objects.pinkKnight.coord.x, 5);
_root.addBoundObject("cannonBallAir", "cannonBallAir" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z - 3, "cannonBall", true, false);
_root.objects["cannonBallAir" + _root.linkedObjects].pos = xSpeed / Math.abs(xSpeed);
_root.linkedObjects++;
if (!_root.birds) {
_root.addBoundObject("blackBirdFace", "blackBirdFace", 450, 300, 200, coord.x, coord.y - 15, coord.z - 8, "blackBirdFace", true, false);
_root.linkedObjects++;
}
removeMovieClip();
}
} else if ((reversed && (specialBlock)) && (_root.hitCheck(_root.objects.cwKnight, this))) {
if (volley >= 3) {
_root.addSound("explosion2", 1);
_root.addSound("explosion2", 1);
_root.objects.cwKnight.cannonHit();
_root.objects.cwKnight.hit(100);
_root.addBoundObject("cannonBallAir", "cannonBallAir" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z - 3, "cannonBall", true, false);
_root.objects["cannonBallAir" + _root.linkedObjects].pos = xSpeed / Math.abs(xSpeed);
_root.linkedObjects++;
removeMovieClip();
} else {
_root.objects.cwKnight.gotoAndStop("deflect");
_root.addSound("ck_armswing", 1);
xSpeed = xSpeed * -1;
zSpeed = zSpeed * -1;
ySpeed = ySpeed * -1;
reversed = false;
}
}
if (coord.y > 200) {
bounced = true;
ySpeed = -12;
zSpeed = 0;
if (xSpeed > 0) {
xSpeed = 10;
} else {
xSpeed = -10;
}
coord.y = 210;
if (_root.birds && (!_root.birdsBomb)) {
_root.objects.blackBirdFace.lockBombX = coord.x;
_root.objects.blackBirdFace.lockBombZ = coord.z;
_root.objects.blackBirdFace.lockBomb = true;
_root.birdsBomb = true;
lockBomb = true;
}
} else if (coord.y < -400) {
removeMovieClip();
}
} else {
if (lockBomb) {
_root.objects.blackBirdFace.lockBombX = coord.x;
_root.objects.blackBirdFace.lockBombZ = coord.z;
}
ySpeed++;
xSpeed = xSpeed - ((xSpeed / Math.abs(xSpeed)) * 0.15);
if (_root.hitCheck(_root.objects.blackBirdFace, this) && (lockBomb)) {
_root.objects.blackBirdFace.countDown = 95 + Math.round(Math.random() * 30);
_root.objects.blackBirdFace.chase = true;
coord.y = 210;
ySpeed = 0;
removeMovieClip();
} else if (coord.y >= 205) {
coord.y = 204;
if (Math.abs(ySpeed) > 5) {
ySpeed = ySpeed * -0.6;
} else if (!lockBomb) {
_root.addSound("explosion2", 1);
_root.addBoundObject("multiExplode", "cannonBallAir" + _root.linkedObjects, 50, 100, 40, coord.x, coord.y - 2, coord.z - 3, "cannonBall", true, false);
_root.objects["cannonBallAir" + _root.linkedObjects].pos = xSpeed / Math.abs(xSpeed);
_root.linkedObjects++;
if (!_root.birds) {
_root.addBoundObject("blackBirdFace", "blackBirdFace", 450, 300, 200, coord.x, coord.y - 15, coord.z - 8, "blackBirdFace", true, false);
} else if (lockBomb) {
_root.birdsBomb = false;
_root.objects.lockBomb = false;
}
removeMovieClip();
}
}
}
render();
}
var xSpeed = 0;
var zSpeed = 0;
var ySpeed = 0;
var speed = 0;
var reversed = false;
var specialBlock = false;
var bounced = false;
var volley = 0;
var lockBomb = false;
}
Symbol 1249 MovieClip Frame 25
stop();
Symbol 1250 MovieClip Frame 946
_parent.play();
Symbol 1268 MovieClip Frame 25
stop();
Symbol 1280 Button
on (release) {
nextFrame();
}
Symbol 1286 Button
on (release) {
prevFrame();
}
Symbol 1289 MovieClip Frame 1
stop();
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "win the game with 15,000 points";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "beat the game within 5 minutes of less ";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "Delfect 3 cannon balls from the bosses SpamCannonAttack";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "Beat the game";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "Kill 3 Minions using the jump Magic";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "Get 6 hits with the spinning Umbrella Attack";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "Use Magic as the final Blow on the Boss";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "Dizzy Boss before First ArmorBreak";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "Beat the game without getting a dizzy";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Instance of Symbol 1295 MovieClip in Symbol 1296 MovieClip Frame 1
on (rollOver) {
_parent.medalInfo._visible = true;
_parent.medalInfo._x = _x;
_parent.medalInfo._y = _y;
_parent.medalInfo.medalInfoText.text = "Get 6 hits with the ground spinning attack";
_parent.medalInfo.curMedal = this;
}
onClipEvent (enterFrame) {
if ((_parent.medalInfo.curMedal == this) && (!hitTest(_parent._xmouse, _parent._ymouse))) {
_parent.medalInfo._visible = false;
}
}
Symbol 1297 MovieClip Frame 1
stop();
Symbol 1297 MovieClip Frame 2
stop();
Symbol 1297 MovieClip Frame 3
stop();
Symbol 1391 MovieClip Frame 372
stop();
_parent.play();
Symbol 1398 Button
on (release) {
prevFrame();
}