Frame 1
function runAchieve(n) {
_root.medal_popup.unlockMedal(n);
var _local7 = true;
var _local4 = 0;
while (_local4 < meds.length) {
var _local2 = meds[_local4];
if (!_local2.gotten) {
if (_local2.nam == n) {
_local2.gotten = true;
so.data.meds[_local4].gotten = true;
trace("Earned: " + n);
}
}
if (!_local2.gotten) {
if (_local2.nam != "Real Ultimate Power") {
_local7 = false;
}
}
_local4++;
}
if (_local7) {
if (!meds[9].gotten) {
_root.medal_popup.unlockMedal("Real Ultimate Power");
meds[9].gotten = true;
so.data.meds[9].gotten = true;
trace("Earned: Real Ultimate Power");
_root.ultimate = true;
}
}
_local7 = true;
var _local5 = NewgroundsAPI.getMedals();
var _local8 = false;
_local4 = 0;
while (_local4 < _local5.length) {
var _local3 = _local5[_local4];
if (!_local3.medal_unlocked) {
if (_local3.medal_name != "Real Ultimate Power") {
_local7 = false;
}
}
if ((_local3.medal_name == "Real Ultimate Power") && (_local3.medal_unlocked)) {
_local8 = true;
}
_local4++;
}
var _local9 = NewgroundsAPI.hasUserSession();
if (!_local9) {
_local7 = false;
}
if (_local7 && (!_local8)) {
_root.medal_popup.unlockMedal("Real Ultimate Power");
}
}
function wipeOut() {
ultimate = false;
var _local1 = 0;
while (_local1 < so.data.meds.length) {
so.data.meds[_local1].gotten = false;
meds[_local1].gotten = false;
_local1++;
}
}
pausetxt.unloadMovie();
pausetxt.removeMovieClip();
Stage.showMenu = false;
meds = new Array();
m = new Array();
m.nam = "Rude awakening";
m.desc = "Defeat Luis' 1st form";
m.picid = 3;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Tighty whitey power";
m.desc = "Defeat Luis' 2nd form";
m.picid = 0;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Stack the deck";
m.desc = "Defeat Luis' 3rd form";
m.picid = 2;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Black Coffin";
m.desc = "Die before killing Luis";
m.picid = 7;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Grape Crush";
m.desc = "Find the 1st alternate ending";
m.picid = 5;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Abyss-mal";
m.desc = "Find the 2nd alternate ending";
m.picid = 8;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Flee powder";
m.desc = "Escape the cave";
m.picid = 1;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Lou Lou Zoom";
m.desc = "Beat the game in under 200 seconds";
m.picid = 4;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Exterminator";
m.desc = "Super Secret";
m.picid = 6;
m.gotten = false;
meds.push(m);
m = new Array();
m.nam = "Real Ultimate Power";
m.desc = "Complete all other achievements";
m.picid = 9;
m.gotten = false;
meds.push(m);
so = SharedObject.getLocal("Moo");
if (so.data.meds == undefined) {
trace("starting new save file, save file is now empty");
so.data.meds = new Array();
var i = 0;
while (i < meds.length) {
so.data.meds[i] = meds[i];
i++;
}
} else {
var i = 0;
while (i < so.data.meds.length) {
meds[i] = so.data.meds[i];
i++;
}
if (meds[9].gotten) {
_root.ultimate = true;
}
}
stop();
_root.API_Settings = {movie_id:8893, enc_key:"G0rscF4GlAtC5OebHGBaJKFJXfkHTghz", debug_mode:false, movie_version:""};
function goThere() {
delete this.onEnterFrame;
aup = false;
_root.frompreloader = true;
this.gotoAndStop("main");
}
stop();
loadtxt.stop();
this.onEnterFrame = function () {
bt = this.getBytesTotal();
bl = this.getBytesLoaded();
perc = (bl / bt) * 100;
bar.gotoAndStop(Math.round(perc));
if ((perc >= 100) && (!this.loadedup)) {
loadtxt.play();
this.loadedup = true;
loadtxt.onPress = function () {
goThere();
};
}
if (this.loadedup) {
if (!Key.isDown(65)) {
aup = true;
}
if (Key.isDown(65) && (aup)) {
goThere();
}
}
};
Frame 3
pausetxt.unloadMovie();
pausetxt.removeMovieClip();
delete this.onEnterFrame;
Frame 4
delete this.onEnterFrame;
_root.fastcv = 0;
Frame 5
stop();
_root.fastcv = 0;
pausetxt.unloadMovie();
pausetxt.removeMovieClip();
Frame 6
stop();
_root.fastcv = 0;
Frame 7
stop();
_root.fastcv = 0;
Frame 8
stop();
Frame 9
stop();
_root.fastcv = 0;
Symbol 15 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 23 MovieClip Frame 12
this._parent.gotoAndStop("raised");
Symbol 31 MovieClip Frame 1
stop();
_root.game.addFlag(this);
Instance of Symbol 31 MovieClip in Symbol 34 MovieClip [tile0] Frame 1
onClipEvent (load) {
this.firstone = true;
}
Symbol 36 MovieClip [antitile1] Frame 1
this.cacheAsBitmap = true;
Symbol 38 MovieClip [antitile2] Frame 1
this.cacheAsBitmap = true;
Symbol 40 MovieClip [antitile3] Frame 1
this.cacheAsBitmap = true;
Symbol 42 MovieClip [antitile4] Frame 1
this.cacheAsBitmap = true;
Symbol 44 MovieClip [antitile8] Frame 1
this.cacheAsBitmap = true;
Symbol 45 MovieClip [antitile7] Frame 1
this.cacheAsBitmap = true;
Symbol 46 MovieClip [antitile6] Frame 1
this.cacheAsBitmap = true;
Symbol 48 MovieClip [antitile10] Frame 1
this.cacheAsBitmap = true;
Symbol 49 MovieClip [antitile11] Frame 1
this.cacheAsBitmap = true;
Symbol 51 MovieClip [antitile9] Frame 1
this.cacheAsBitmap = true;
Symbol 53 MovieClip [antitile5] Frame 1
this.cacheAsBitmap = true;
Symbol 62 MovieClip Frame 1
_root.game.addRepel(this);
Instance of Symbol 62 MovieClip in Symbol 63 MovieClip [tile1] Frame 1
onClipEvent (load) {
this.dir = 1;
}
Instance of Symbol 62 MovieClip in Symbol 63 MovieClip [tile1] Frame 1
onClipEvent (load) {
this.dir = -1;
}
Symbol 79 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 104 MovieClip Frame 136
gotoAndPlay ("stick");
Symbol 109 MovieClip Frame 10
stop();
Symbol 115 Button
on (release) {
this._visible = false;
}
Symbol 122 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 136 MovieClip Frame 1
function unlockMedal(m_name) {
clearInterval(pop_delay);
var _local3 = com.Newgrounds.NewgroundsAPI.getMedals();
var _local2 = null;
var _local5 = false;
for (i in _local3) {
if (_local3[i].medal_name == m_name) {
_local2 = _local3[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;
_local5 = true;
gotoAndPlay (2);
break;
}
}
if (!_local5) {
i = 0;
while (i < _root.meds.length) {
if (_root.meds[i].nam == m_name) {
_local2 = _root.meds[i];
medal_name = _local2.nam;
medal_value = "";
pop_delay = setInterval(endDelay, 3000);
_visible = true;
gotoAndPlay (2);
break;
}
i++;
}
}
}
function endDelay(params) {
gotoAndPlay (10);
clearInterval(pop_delay);
}
stop();
var pop_delay;
var medal_name = "?????";
var medal_value = "???";
_visible = false;
Symbol 136 MovieClip Frame 10
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Symbol 138 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1444 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 1445 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 1446 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 1447 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 1448 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 1449 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 1450 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 1451 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 151 MovieClip Frame 15
stop();
var tar = this._parent._parent;
_root.game.removeHittable(tar);
Symbol 152 MovieClip Frame 1
stop();
Symbol 154 MovieClip [brickholder] Frame 1
stop();
this.hit = false;
Symbol 167 MovieClip [doublejumpburst] Frame 8
this.unloadMovie();
this.removeMovieClip();
Symbol 179 MovieClip [hpcounter] Frame 1
Symbol 187 MovieClip [jumppoof] Frame 14
this.unloadMovie();
this.removeMovieClip();
Symbol 194 MovieClip Frame 1
stop();
Symbol 202 MovieClip [msmoke] Frame 25
this.unloadMovie();
this.removeMovieClip();
Symbol 209 MovieClip [spark] Frame 7
this.unloadMovie();
this.removeMovieClip();
Symbol 222 MovieClip [target] Frame 12
gotoAndPlay ("loop");
Instance of Symbol 62 MovieClip in Symbol 226 MovieClip [tile10] Frame 1
onClipEvent (load) {
this.dir = -1;
}
Symbol 231 MovieClip Frame 1
if (!this.inited) {
this.inited = true;
_root.game.addBoulder(this);
}
stop();
Symbol 233 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 235 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 253 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if ((!_root.game.pausy) && (!_root.game.ultrapause)) {
this.cv++;
if (this.cv >= this.limit) {
delete this.onEnterFrame;
this.cv = 0;
this.gotoAndPlay("slam");
}
}
};
Symbol 253 MovieClip Frame 3
_root.game.chkPoundPlay(this);
Symbol 253 MovieClip Frame 5
_root.game.chkSmack(this.box, 0, this);
Symbol 253 MovieClip Frame 7
_root.game.chkSmack(this.box, 0, this);
Symbol 253 MovieClip Frame 9
_root.game.chkSmack(this.box, 0, this);
Symbol 253 MovieClip Frame 11
_root.game.chkSmack(this.box, 0, this);
Symbol 253 MovieClip Frame 13
_root.game.chkSmack(this.box, 0, this);
Symbol 253 MovieClip Frame 15
_root.game.chkSmack(this.box, 0, this);
Symbol 253 MovieClip Frame 17
_root.game.chkSmack(this.box, 0, this);
Symbol 253 MovieClip Frame 19
_root.game.chkSmack(this.box, 0, this);
Instance of Symbol 253 MovieClip in Symbol 254 MovieClip [tile11] Frame 1
onClipEvent (load) {
cv = 20;
limit = 0;
}
Instance of Symbol 62 MovieClip in Symbol 254 MovieClip [tile11] Frame 1
onClipEvent (load) {
this.dir = -1;
}
Instance of Symbol 253 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
cv = 0;
limit = 35;
}
Instance of Symbol 253 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
cv = 10;
limit = 35;
}
Instance of Symbol 253 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
cv = 20;
limit = 35;
}
Instance of Symbol 253 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
cv = 25;
limit = 50;
}
Instance of Symbol 253 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
cv = 0;
limit = 50;
}
Instance of Symbol 253 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
cv = 25;
limit = 50;
}
Instance of Symbol 253 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
cv = 0;
limit = 50;
}
Instance of Symbol 62 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
this.dir = 1;
}
Instance of Symbol 62 MovieClip in Symbol 260 MovieClip [tile4] Frame 1
onClipEvent (load) {
this.dir = -1;
}
Symbol 269 MovieClip Frame 13
stop();
Symbol 270 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 1
this.cv = 0;
this.yvel = 0;
stop();
this.onEnterFrame = function () {
if ((!_root.game.pausy) && (!_root.game.ultrapause)) {
if (!this.launched) {
cv++;
if (cv >= 50) {
cv = 0;
this.launched = true;
this.yvel = -45;
}
} else {
this._y = this._y + this.yvel;
if (this.yvel > -10) {
if (this.yvel > 10) {
this.guts.gotoAndStop("down");
} else {
this.guts.gotoAndStop("turn");
}
}
_root.game.chkSmack(this, 0, this);
this.yvel = this.yvel + _root.game.GRAV;
if (this._y > 550) {
this.launched = false;
this.yvel = 0;
this.guts.gotoAndStop("up");
}
}
}
};
Symbol 273 MovieClip Frame 1
this.cacheAsBitmap = true;
Instance of Symbol 62 MovieClip in Symbol 275 MovieClip [tile7] Frame 1
onClipEvent (load) {
this.dir = -1;
}
Instance of Symbol 62 MovieClip in Symbol 276 MovieClip [tile8] Frame 1
onClipEvent (load) {
this.dir = -1;
}
Instance of Symbol 62 MovieClip in Symbol 277 MovieClip [tile9] Frame 1
onClipEvent (load) {
this.dir = -1;
}
Symbol 284 MovieClip [bubblewrap] Frame 30
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 294 MovieClip [hugeblast] Frame 7
_root.game.clearBlocks(this, this.box);
Symbol 294 MovieClip [hugeblast] Frame 17
this.unloadMovie();
this.removeMovieClip();
Symbol 323 MovieClip [splode] Frame 36
this.unloadMovie();
this.removeMovieClip();
Symbol 355 MovieClip Frame 1
stop();
Symbol 355 MovieClip Frame 2
stop();
Symbol 355 MovieClip Frame 3
stop();
Symbol 365 MovieClip Frame 1
this.hitarea.onPress = function () {
getURL ("http://www.newgrounds.com/powerofthree2009", "_blank");
};
Symbol 366 MovieClip Frame 1
nglink.onPress = function () {
getURL ("http://www.newgrounds.com/powerofthree2009", "_blank");
};
Symbol 374 MovieClip Frame 1
function startAd(ngad_url) {
trace("opening " + ngad_url);
System.security.allowDomain("70.87.128.99");
System.security.allowInsecureDomain("70.87.128.99");
System.security.allowDomain("ads.shizmoo.com");
System.security.allowInsecureDomain("ads.shizmoo.com");
System.security.allowDomain("www.cpmstar.com");
System.security.allowInsecureDomain("www.cpmstar.com");
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (success) {
trace("[NEWGROUNDS FLASH ADS] :: You may get a 'Security Sandbox Violation' ... this is normal, do not freak out!");
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Symbol 380 MovieClip Frame 29
gotoAndPlay (1);
Symbol 434 MovieClip Frame 1
but_luis.onPress = function () {
getURL ("http://luis.newgrounds.com", "_blank");
};
but_nick.onPress = function () {
getURL ("http://bomtoons.newgrounds.com", "_blank");
};
but_rucklo.onPress = function () {
getURL ("http://rucklo.newgrounds.com", "_blank");
};
Symbol 463 MovieClip Frame 1
stop();
Symbol 463 MovieClip Frame 2
stop();
Symbol 467 MovieClip Frame 1
function updateIt() {
var _local7 = 0;
while (_local7 < _root.meds.length) {
var _local6 = _root.meds[_local7];
var _local4 = this["b" + _local7];
if (!_local6.gotten) {
_local4.gotoAndStop(2);
} else {
_local4.gotoAndStop(1);
}
_local4.tit.text = _local6.nam;
_local4.bod.text = _local6.desc;
var _local3 = 0;
while (_local3 < _root.meds.length) {
var _local5 = _local4["ike" + _local3];
_local5._visible = false;
_local3++;
}
var _local8 = _local4["ike" + _local6.picid];
_local8._visible = true;
_local7++;
}
}
but_cleardata.onPress = function () {
_root.wipeOut();
this._parent.updateIt();
};
updateIt();
Symbol 475 MovieClip Frame 1
if (_root.frompreloader) {
_root.frompreloader = false;
gotoAndPlay (3);
} else {
gotoAndPlay ("skipper");
}
Symbol 475 MovieClip Frame 3
aup = false;
this.onEnterFrame = function () {
if (!Key.isDown(65)) {
aup = true;
}
if (Key.isDown(65) && (aup)) {
aup = false;
delete this.onEnterFrame;
gotoAndPlay ("skipper");
}
};
Symbol 475 MovieClip Frame 4
splat = new Sound(this);
splat.attachSound("splat");
Symbol 475 MovieClip Frame 54
bug.onPress = function () {
_root.runAchieve("Exterminator");
this._parent.splat.start();
this.gotoAndStop("splat");
};
Symbol 475 MovieClip Frame 267
bug.onPress = function () {
_root.runAchieve("Exterminator");
this._parent.splat.start();
this.gotoAndStop("splat");
};
Symbol 475 MovieClip Frame 515
function moreGames() {
getURL ("http://www.newgrounds.com/powerofthree2009", "_blank");
}
function goStart() {
stopAllSounds();
_root.gotoAndStop("game");
}
function goMedals() {
delete this.onEnterFrame;
gotoAndPlay ("medalgo");
}
stop();
aup = false;
this.onEnterFrame = function () {
if (!Key.isDown(65)) {
aup = true;
}
if (Key.isDown(65) && (aup)) {
goStart();
}
};
but_moregames.onPress = function () {
moreGames();
};
but_start.onPress = function () {
delete this.onEnterFrame;
goStart();
};
but_medals.onPress = function () {
goMedals();
};
Symbol 475 MovieClip Frame 575
function goBack() {
gotoAndPlay ("retract");
}
stop();
but_back.onPress = function () {
goBack();
};
Symbol 475 MovieClip Frame 619
gotoAndStop ("main");
Symbol 526 MovieClip Frame 21
stop();
_root.game.bg1.cacheAsBitmap = true;
Symbol 527 MovieClip Frame 1
stop();
Symbol 529 MovieClip Frame 1
stop();
ball.hits = 0;
Symbol 529 MovieClip Frame 32
_root.game.flashIt();
ball.gotoAndStop("break");
Symbol 529 MovieClip Frame 57
_root.game.screenshake = 20;
Symbol 529 MovieClip Frame 94
stop();
_root.game.runBossEntrance();
Symbol 533 MovieClip Frame 1
stop();
Symbol 549 MovieClip Frame 1
stop();
if (_root.ultimate) {
this.gotoAndStop(2);
}
Symbol 628 MovieClip Frame 1
stop();
Symbol 636 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 638 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 642 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 670 MovieClip Frame 9
_root.game.screenshake = 15;
Symbol 670 MovieClip Frame 26
_root.game.screenshake = 15;
Symbol 717 MovieClip Frame 5
_root.game.chkSmack(this.box, 5);
Symbol 717 MovieClip Frame 7
_root.game.chkSmack(this.box, 5);
Symbol 717 MovieClip Frame 9
_root.game.chkSmack(this.box, 5);
Symbol 717 MovieClip Frame 11
_root.game.chkSmack(this.box, 5);
Symbol 717 MovieClip Frame 13
_root.game.chkSmack(this.box, 5);
Symbol 717 MovieClip Frame 15
_root.game.chkSmack(this.box, 5);
Symbol 717 MovieClip Frame 17
_root.game.chkSmack(this.box, 5);
Symbol 717 MovieClip Frame 19
_root.game.chkSmack(this.box, 5);
gotoAndPlay ("loop");
Symbol 736 MovieClip Frame 1
_root.game.chkSmack(this.box, 5, this._parent._parent._parent);
Symbol 736 MovieClip Frame 13
stop();
Symbol 742 MovieClip Frame 7
_root.game.makeFireBall(0);
Symbol 742 MovieClip Frame 13
stop();
Symbol 750 MovieClip Frame 7
_root.game.makeFireBall(1);
Symbol 750 MovieClip Frame 13
stop();
Symbol 757 MovieClip Frame 7
_root.game.makeFireBall(2);
Symbol 757 MovieClip Frame 13
stop();
Symbol 810 MovieClip Frame 3
_root.game.chkSmack(this.box, 5);
Symbol 810 MovieClip Frame 5
_root.game.chkSmack(this.box, 5);
Symbol 810 MovieClip Frame 7
_root.game.chkSmack(this.box, 5);
Symbol 810 MovieClip Frame 9
_root.game.chkSmack(this.box, 5);
Symbol 810 MovieClip Frame 11
gotoAndPlay ("loop");
Symbol 834 MovieClip Frame 5
stop();
Symbol 855 MovieClip Frame 19
_root.game.flashIt();
Symbol 855 MovieClip Frame 24
_root.game.flashIt();
Symbol 855 MovieClip Frame 29
_root.game.flashIt();
Symbol 855 MovieClip Frame 34
_root.game.flashIt();
Symbol 855 MovieClip Frame 39
_root.game.flashIt();
Symbol 855 MovieClip Frame 44
_root.game.flashIt();
Symbol 855 MovieClip Frame 49
_root.game.flashIt();
Symbol 855 MovieClip Frame 54
_root.game.flashIt();
Symbol 855 MovieClip Frame 59
_root.game.flashIt();
Symbol 855 MovieClip Frame 64
_root.game.flashIt();
Symbol 855 MovieClip Frame 69
_root.game.flashIt();
Symbol 855 MovieClip Frame 74
_root.game.flashIt();
Symbol 855 MovieClip Frame 79
_root.game.flashIt();
Symbol 855 MovieClip Frame 84
_root.game.flashIt();
Symbol 855 MovieClip Frame 89
_root.game.flashIt();
Symbol 855 MovieClip Frame 93
_root.game.flashIt();
Symbol 855 MovieClip Frame 98
_root.game.flashIt();
Symbol 855 MovieClip Frame 102
_root.game.flashIt();
Symbol 855 MovieClip Frame 114
_root.game.flashIt();
Symbol 855 MovieClip Frame 126
_root.game.screenshake = 25;
Symbol 855 MovieClip Frame 130
_root.game.switchBossForm(2);
Symbol 894 MovieClip Frame 34
_root.game.chkSmack(this.box, 5);
Symbol 894 MovieClip Frame 36
_root.game.chkSmack(this.box, 5);
Symbol 894 MovieClip Frame 38
_root.game.chkSmack(this.box, 5);
Symbol 894 MovieClip Frame 40
_root.game.chkSmack(this.box, 5);
Symbol 894 MovieClip Frame 42
_root.game.chkSmack(this.box, 5);
Symbol 894 MovieClip Frame 44
_root.game.chkSmack(this.box, 5);
Symbol 894 MovieClip Frame 45
gotoAndPlay ("loop");
Symbol 916 MovieClip Frame 1
if (!_root.game.panties) {
_root.game.panties = true;
gotoAndPlay ("loop");
}
Symbol 916 MovieClip Frame 24
_root.game.screenshake = 15;
Symbol 916 MovieClip Frame 40
_root.game.screenshake = 15;
Symbol 916 MovieClip Frame 50
gotoAndPlay ("loop");
Symbol 943 MovieClip Frame 7
_root.game.flashIt();
Symbol 943 MovieClip Frame 14
_root.game.flashIt();
Symbol 943 MovieClip Frame 22
_root.game.flashIt();
Symbol 943 MovieClip Frame 32
_root.game.flashIt();
Symbol 943 MovieClip Frame 42
_root.game.flashIt();
Symbol 943 MovieClip Frame 50
_root.game.flashIt();
Symbol 943 MovieClip Frame 59
_root.game.flashIt();
Symbol 943 MovieClip Frame 70
_root.game.flashIt();
Symbol 943 MovieClip Frame 83
_root.game.flashIt();
Symbol 943 MovieClip Frame 139
_root.game.flashIt();
_root.game.removePlats();
Symbol 943 MovieClip Frame 235
_root.game.switchBossForm(3);
Symbol 947 MovieClip Frame 14
_root.game.dropBrick();
Symbol 947 MovieClip Frame 38
_root.game.endBossDrop();
Symbol 962 MovieClip Frame 79
stop();
Symbol 1001 MovieClip Frame 112
stop();
_root.game.finalTalk();
Symbol 1001 MovieClip Frame 193
_root.game.startFinal();
Symbol 1001 MovieClip Frame 198
stop();
Symbol 1002 MovieClip Frame 1
stop();
Symbol 1003 MovieClip Frame 1
stop();
Symbol 1040 MovieClip Frame 1
if (_root.ultimate) {
goldy._visible = true;
} else {
goldy._visible = false;
}
Symbol 1040 MovieClip Frame 30
stop();
_root.game.gotSword();
Symbol 1053 MovieClip Frame 2
_root.game.chkHit(this._parent._parent, this.box, true);
Symbol 1053 MovieClip Frame 4
_root.game.chkHit(this._parent._parent, this.box, true);
Symbol 1053 MovieClip Frame 6
_root.game.chkHit(this._parent._parent, this.box, true);
Symbol 1053 MovieClip Frame 8
_root.game.chkHit(this._parent._parent, this.box, true);
Symbol 1065 MovieClip Frame 3
_root.game.chkHit(this._parent._parent, this.box);
Symbol 1065 MovieClip Frame 5
_root.game.chkHit(this._parent._parent, this.box);
Symbol 1065 MovieClip Frame 7
_root.game.chkHit(this._parent._parent, this.box);
_root.game.endAtk(this._parent._parent);
Symbol 1072 MovieClip Frame 30
_root.game.endJumpGet(this._parent._parent);
Symbol 1081 MovieClip Frame 4
_root.game.chkHit(this._parent._parent, this.box);
Symbol 1081 MovieClip Frame 6
_root.game.chkHit(this._parent._parent, this.box);
Symbol 1081 MovieClip Frame 8
_root.game.chkHit(this._parent._parent, this.box);
_root.game.endAtk(this._parent._parent);
Symbol 1088 MovieClip Frame 5
_root.game.chkHit(this._parent._parent, this.box);
Symbol 1088 MovieClip Frame 7
_root.game.chkHit(this._parent._parent, this.box);
Symbol 1088 MovieClip Frame 8
_root.game.chkHit(this._parent._parent, this.box);
_root.game.endAtk(this._parent._parent);
Symbol 1099 MovieClip Frame 18
stop();
Symbol 1109 MovieClip Frame 18
stop();
Symbol 1116 MovieClip Frame 20
stop();
Symbol 1117 MovieClip Frame 1
stop();
Symbol 1127 MovieClip Frame 1
function chkPoundPlay(who) {
who.virtx = (who._x + who._parent._x) + this._x;
dude.virtx = dude._x + this._x;
if ((who.virtx < (dude.virtx + 300)) && (who.virtx > (dude.virtx - 300))) {
pound.start();
}
}
function countUp() {
if (!pausy) {
_root.fastcv++;
}
}
function changeMusic(n) {
stopAllSounds();
curmuse = n;
n.start(0, 99);
n.setVolume(bgvol);
}
function phys(who) {
if (who.blinking) {
you._x = who._x;
you._y = who._y;
who.blinkcv++;
who._visible = !who._visible;
if (who.blinkcv >= 120) {
you.unloadMovie();
you.removeMovieClip();
who.blinkcv = 0;
who.blinking = false;
who._visible = true;
}
}
if (!gameoverwait) {
if (who._y > 550) {
fellinpit = true;
curmuse.setVolume(0);
fallsound.start();
ultrapause = true;
lives--;
gameoverwait = true;
gameoverwaitcv = 50;
}
}
var _local5 = Math.abs(who.xvel);
if (_local5 < 1) {
who.xvel = 0;
}
who._x = who._x + who.xvel;
who.xvel = who.xvel * FRIC;
who.virtx = who._x + this._x;
who.virty = who._y + this._y;
who.yvel = who.yvel + GRAV;
if (who.yvel > 0) {
var _local4 = who._y + who.yvel;
while (who._y < _local4) {
who._y++;
who.virty++;
while (antiwalk.hitTest(who.virtx, who.virty, true)) {
who.jumping = false;
who.yvel = 0;
who._y--;
who.virty--;
_local4 = who._y;
who.jumpcount = 0;
who.fallen = false;
}
}
} else {
who._y = who._y + who.yvel;
if (finalrun) {
var _local3 = 0;
while (_local3 < walls.length) {
tar = walls[_local3];
if (tar.noup0.hitTest(who.virtx, who.virty - 40, true) || (tar.noup1.hitTest(who.virtx, who.virty - 40, true))) {
who.yvel = 5;
}
_local3++;
}
_local3 = 0;
while (_local3 < boulders.length) {
tar = boulders[_local3];
if (tar.hitTest(who.virtx, who.virty - 60, true)) {
who._y = who._y + 5;
who.yvel = 8;
}
_local3++;
}
}
}
}
function phys2(who) {
var _local4 = Math.abs(who.xvel);
if (_local4 < 1) {
who.xvel = 0;
}
who._x = who._x + who.xvel;
who.xvel = who.xvel * FRIC;
who.virtx = who._x + this._x;
who.virty = who._y + this._y;
who.yvel = who.yvel + GRAV;
if (who.yvel > 0) {
var _local3 = who._y + who.yvel;
while (who._y < _local3) {
who._y++;
who.virty++;
while (antiwalk.hitTest(who.virtx, who.virty, true)) {
who.jumping = false;
who.yvel = 0;
who._y--;
who.virty--;
_local3 = who._y;
who.jumpcount = 0;
who.fallen = false;
}
}
} else {
who._y = who._y + who.yvel;
}
}
function controls(who) {
who.expirecv++;
if (who.expirecv >= 12) {
who.expirecv = 0;
who.atkpointer = 0;
}
who.virtx = who._x + this._x;
who.virty = who._y + this._y;
if (!who.hit) {
if (!Key.isDown(A)) {
aup = true;
}
if (Key.isDown(A) && (aup)) {
aup = false;
if (((!who.attacking) && (who.jumpcount < 2)) && (who.gotsword)) {
var t = eval ("swing" + who.swingcv);
t.start();
who.swingcv++;
if (who.swingcv == 3) {
who.swingcv = 0;
}
who.attacking = true;
who.guts.gotoAndStop("atk" + who.atkpointer);
who.expirecv = 0;
who.atkpointer++;
if (who.atkpointer == 3) {
who.atkpointer = 0;
}
}
}
who.moving = false;
if (Key.isDown(R)) {
who.xvel = who.xvel + who.sp;
who._xscale = 100;
who.moving = true;
if (finalrun) {
var i = 0;
while (i < walls.length) {
tar = walls[i];
if (tar.hitarea.hitTest(who.virtx + 40, who.virty, true) || (tar.hitarea1.hitTest(who.virtx + 40, who.virty, true))) {
who.xvel = who.xvel - who.sp;
}
i++;
}
var i = 0;
while (i < boulders.length) {
tar = boulders[i];
if (tar.hitarea.hitTest(who.virtx + 40, who.virty, true)) {
who.xvel = who.xvel - who.sp;
}
i++;
}
}
}
if (Key.isDown(L)) {
who.xvel = who.xvel - who.sp;
who._xscale = -100;
who.moving = true;
if (finalrun) {
var i = 0;
while (i < walls.length) {
tar = walls[i];
if (tar.hitarea.hitTest(who.virtx - 40, who.virty, true) || (tar.hitarea1.hitTest(who.virtx - 40, who.virty, true))) {
who.xvel = who.xvel + who.sp;
}
i++;
}
var i = 0;
while (i < boulders.length) {
tar = boulders[i];
if (tar.hitarea.hitTest(who.virtx - 40, who.virty, true)) {
who.xvel = who.xvel + who.sp;
}
i++;
}
}
}
if ((who.moving && (who.jumpcount == 0)) && (!who.attacking)) {
if (!who.gotsword) {
who.guts.gotoAndStop("move");
} else {
who.guts.gotoAndStop("movesword");
}
}
if ((!who.moving) && (who.jumpcount == 0)) {
if (!who.attacking) {
if (!who.gotsword) {
who.guts.gotoAndStop("rest");
} else {
who.guts.gotoAndStop("swordrest");
}
}
}
if (!Key.isDown(J)) {
jup = true;
}
if (who.yvel > 3) {
if ((who.jumpcount == 0) && (!who.fallen)) {
who.jumpcount = 1;
who.fallen = true;
}
if (who.jumpcount == 2) {
if (!who.gotsword) {
who.guts.gotoAndStop("jumpball");
} else {
who.guts.gotoAndStop("jumpballsword");
who.attacking = false;
}
} else if (!who.attacking) {
if (!who.gotsword) {
who.guts.gotoAndStop("jump");
} else {
who.guts.gotoAndStop("jumpsword");
}
}
}
if (jup && (Key.isDown(J))) {
jup = false;
if (who.jumpcount < who.maxjump) {
jumpsound.start();
who.jumpcount++;
who.yvel = -who.jmpht;
if (who.jumpcount == 1) {
var jp = this.effects.attachMovie("jumppoof", "jpoof" + effcv, effcv + 99);
effcv++;
jp._x = who._x;
jp._y = who._y;
}
if (who.jumpcount == 2) {
var jp = this.effects.attachMovie("doublejumpburst", "jpoof" + effcv, effcv + 99);
effcv++;
jp._x = who._x;
jp._y = who._y;
}
if (who.jumpcount == 2) {
if (!who.gotsword) {
who.guts.gotoAndStop("jumpball");
} else {
who.guts.gotoAndStop("jumpballsword");
who.attacking = false;
}
} else if (!who.attacking) {
if (!who.gotsword) {
who.guts.gotoAndStop("jump");
} else {
who.guts.gotoAndStop("jumpsword");
}
}
}
}
if ((((who._x > 900) && (!locked)) && (who.gotsword)) && (who.maxjump > 1)) {
LEFTSIDE = 550;
locked = true;
}
} else {
who.hitcv++;
who.guts.gotoAndStop("hit");
if (who.hitcv >= 15) {
who.hitcv = 0;
who.hit = false;
}
}
}
function centerOn(who) {
if (who._x < 13755) {
if (who._y < -50) {
who._y = -50;
}
} else if (who._y < -50) {
ultrapause = true;
_root.distmeter._visible = false;
clearInterval(this.fastcount);
stopAllSounds();
_root.fadeout.gotoAndPlay(2);
}
this._x = ((-who._x) + (Stage.width / 2)) + screenshake;
if (who._x > RIGHTSIDE) {
who._x = RIGHTSIDE;
if (who.hit) {
who.xvel = -who.xvel;
}
}
if (who._x < LEFTSIDE) {
who._x = LEFTSIDE;
if (who.hit) {
who.xvel = -who.xvel;
}
}
if (this._x > ((-LEFTSIDE) + screenshake)) {
this._x = (-LEFTSIDE) + screenshake;
}
if (this._x < (((-RIGHTSIDE) + screenshake) + Stage.width)) {
this._x = ((-RIGHTSIDE) + screenshake) + Stage.width;
}
fg._x = this._x * 0.3;
bg1._x = (-this._x) * 0.5;
bg2._x = -this._x;
flasher._x = -this._x;
dude.virtx = dude._x + this._x;
dude.virty = dude._y + this._y;
}
function chkBonus(who) {
if (sword.hitarea.hitTest(who) && (sword._visible)) {
dude.gotsword = true;
sword._visible = false;
convopointer = -1;
convo = new Array();
convo[0] = new Array("I got a SWORD! Press \"A\" to attack!", 1);
runConvo(convo);
flashIt();
nokeys = true;
who.guts.gotoAndStop("getsword");
}
if (dbljump.hitarea.hitTest(who) && (who.maxjump < 2)) {
flashIt();
who.attacking = false;
who.maxjump = 2;
convopointer = -1;
convo = new Array();
convo[0] = new Array("My legs art strengthened! Press \"UP\" while in the air for an extra boost!", 2);
runConvo(convo);
nokeys = true;
who.guts.gotoAndStop("getjump");
who._xscale = 100;
dbljump._visible = false;
}
}
function endJumpGet() {
if (!talking) {
nokeys = false;
}
if (!dude.gotsword) {
dude.guts.gotoAndStop("rest");
} else {
dude.guts.gotoAndStop("swordrest");
}
}
function gotSword() {
dude.guts.gotoAndStop("swordrest");
if (!talking) {
nokeys = false;
}
}
function endAtk(who) {
who.attacking = false;
}
function addBoulder(who) {
var _local2 = antiwalk.attachMovie("hairyball_platform", "hbp" + effcv, effcv);
effcv++;
_local2._x = who._parent._x + who._x;
_local2._y = who._parent._y + who._y;
who.partner = _local2;
who.hp = 10;
who.recovercv = 0;
who.home = who._x;
who.typ = "boulder";
boulders.push(who);
hitables.push(who);
}
function removeBoulder(who) {
who.partner.unloadMovie();
who.partner.removeMovieClip();
who.unloadMovie();
who.removeMovieClip();
}
function removeHittable(who, replace) {
var _local2 = 0;
while (_local2 < hitables.length) {
if (hitables[_local2] == who) {
hitables.splice(_local2, 1);
if (replace) {
liquidBrick(who._x, who._y);
}
who.partner.unloadMovie();
who.partner.removeMovieClip();
who.unloadMovie();
who.removeMovieClip();
}
_local2++;
}
}
function chkHit(who, box, spin) {
var i = 0;
while (i < hitables.length) {
var b = hitables[i];
if ((((((b.typ == "brick") && (!b.hit)) && (!b.inair)) && (!b.fried)) && (b != faller)) && (!spin)) {
if (b.hitarea.hitTest(box)) {
b.gotoAndPlay("hit");
b.hit = true;
b.hp--;
if (_root.ultimate) {
b.hp--;
}
if (!spin) {
makeHitSpark(who);
} else {
var jp = this.effects.attachMovie("doublejumpburst", "jpoof" + effcv, effcv + 99);
effcv++;
jp._x = dude._x;
jp._y = dude._y;
}
if (spin) {
if (b._x > who._x) {
who.xvel = -who.rebound;
} else {
who.xvel = who.rebound;
}
who.yvel = -15;
}
if (_root.ultimate) {
showHp(b, 2);
} else {
showHp(b, 1);
}
var ran = random(2);
player = eval ("hit" + ran);
player.start();
screenshake = 5;
if (b.hp <= 0) {
removeHittable(b);
for (n in bricks) {
var tar = bricks[n];
if (tar.typ == "brick") {
removeHittable(tar, true);
}
}
}
}
}
if ((!b.hit) && (!b.dead)) {
if (b.typ == "wall") {
if (b.hitarea.hitTest(box) || (b.hitarea1.hitTest(box))) {
b.hit = true;
var ran = random(2);
player = eval ("hit" + ran);
player.start();
screenshake = 5;
if (!spin) {
makeHitSpark(who);
} else {
var jp = this.effects.attachMovie("doublejumpburst", "jpoof" + effcv, effcv + 99);
effcv++;
jp._x = dude._x;
jp._y = dude._y;
}
if (b.hitarea.hitTest(box)) {
var hip = (b.hitarea._x + b.hitarea._parent._x);
}
if (b.hitarea1.hitTest(box)) {
var hip = (b.hitarea1._x + b.hitarea1._parent._x);
}
if (spin) {
b.recovercv = 5;
if (hip > who._x) {
who.xvel = -who.rebound;
} else {
who.xvel = who.rebound;
}
who.yvel = -15;
}
}
}
if ((b.typ == "boulder") && (!b.dead)) {
if (b.hitarea.hitTest(box)) {
b.hit = true;
var ran = random(2);
player = eval ("hit" + ran);
player.start();
screenshake = 5;
if (!spin) {
if (_root.ultimate) {
showHp(b, 5);
b.hp = b.hp - 5;
} else {
b.hp = b.hp - 3;
showHp(b, 3);
}
makeHitSpark(who);
} else {
if (_root.ultimate) {
showHp(b, 3);
b.hp = b.hp - 3;
} else {
b.hp = b.hp - 1;
showHp(b, 1);
}
var jp = this.effects.attachMovie("doublejumpburst", "jpoof" + effcv, effcv + 99);
effcv++;
jp._x = dude._x;
jp._y = dude._y;
}
if (spin) {
b.recovercv = 5;
var dax = (b._x + b._parent._x);
if (dax > who._x) {
who.xvel = -who.rebound;
} else {
who.xvel = who.rebound;
}
var day = (b._y + b._parent._y);
if (day > who._y) {
who.yvel = -15;
} else {
who.yvel = 5;
}
}
if (b.hp <= 0) {
b.dead = true;
removeBoulder(b);
}
b.gotoAndPlay(2);
}
}
if (b.typ == "device") {
if (b.hitarea.hitTest(box)) {
var ran = random(2);
player = eval ("hit" + ran);
player.start();
screenshake = 5;
b.home = b._x;
b.dir = 1;
b.hit = true;
if (_root.ultimate) {
b.numhits = b.numhits + 2;
showHp(b, 2);
} else {
b.numhits++;
showHp(b, 1);
}
if (b.numhits >= 6) {
flashIt();
makeSplode(b._x, b._y);
screenshake = 15;
b.dead = true;
if (bg1.luis.ball.hits < 4) {
bg1.luis.ball.hits++;
bg1.luis.ball.gotoAndStop(bg1.luis.ball.hits);
}
}
b.gotoAndStop(b.numhits);
if (!spin) {
makeHitSpark(who);
} else {
var jp = this.effects.attachMovie("doublejumpburst", "jpoof" + effcv, effcv + 99);
effcv++;
jp._x = dude._x;
jp._y = dude._y;
}
if (spin) {
if (b._x > who._x) {
who.xvel = -who.rebound;
} else {
who.xvel = who.rebound;
}
who.yvel = -15;
}
}
}
if (b.typ == "boss") {
if ((!b.hit) && (!b.dead)) {
if (b.guts.hitarea.hitTest(box)) {
if (!spin) {
if (_root.ultimate) {
b.hp = b.hp - 5;
showHp(b, 5);
} else {
b.hp = b.hp - 3;
showHp(b, 3);
}
} else if (_root.ultimate) {
b.hp = b.hp - 3;
showHp(b, 3);
} else {
b.hp = b.hp - 1;
showHp(b, 1);
}
updateHud();
var ran = random(2);
player = eval ("hit" + ran);
player.start();
var ran = random(2);
screenshake = 5;
player = eval ("hit" + ran);
b.gotoAndPlay("hit");
b.hit = true;
if (!spin) {
makeHitSpark(who);
} else {
var jp = this.effects.attachMovie("doublejumpburst", "jpoof" + effcv, effcv + 99);
effcv++;
jp._x = dude._x;
jp._y = dude._y;
}
if (spin) {
if (b._x > who._x) {
who.xvel = -who.rebound;
} else {
who.xvel = who.rebound;
}
who.yvel = -15;
}
if (b.form == 3) {
b._y = b._y + 70;
if (dude._x > b._x) {
b._x = b._x - 20;
} else {
b._x = b._x + 20;
}
}
}
}
}
}
i++;
}
}
function showHp(who, amt) {
var _local3 = this.attachMovie("hpcounter", "hp" + effcv, effcv + 99981);
effcv++;
_local3._x = dude._x + ((dude._xscale / 100) * 50);
_local3._y = dude._y;
_local3.msg.text = "-" + amt;
_local3.yvel = -(random(10) + 5);
_local3.xvel = random(4) - 2;
_local3.onEnterFrame = function () {
if ((!_root.game.pausy) && (!_root.game.ultrapause)) {
this._y = this._y + this.yvel;
this._x = this._x + this.xvel;
this.yvel = this.yvel + _root.game.GRAV;
this.xvel = this.xvel * 0.99;
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
}
};
}
function clearBlocks(who, box) {
for (i in bricks) {
var _local1 = bricks[i];
if (_local1.typ == "brick") {
if ((_local1._y > (who._y - 45)) && (_local1._y < (who._y + 45))) {
_local1.partner.unloadMovie();
_local1.partner.removeMovieClip();
_local1.cacheAsBitmap = false;
_local1.guts.gotoAndStop("fry");
_local1.fried = true;
} else {
removeHittable(_local1, true);
}
}
}
}
function chkSmack(box, amt, who) {
if (_root.ultimate) {
amt = amt / 2;
}
if (who == undefined) {
var who = boss;
}
if (((!dude.hit) && (!gameoverwait)) && (!dude.blinking)) {
if (box.hitTest(dude.guts.hitarea)) {
if (who.typ == "stalag") {
squished = true;
}
_root.hud.guts.face.gotoAndPlay("damage");
flashIt();
var ran = random(2);
player = eval ("hit" + ran);
player.start();
dude.hit = true;
flashIt();
dude.attacking = false;
var jp = this.effects.attachMovie("jumppoof", "jpoof" + effcv, effcv + 99);
effcv++;
jp._x = dude._x;
jp._y = dude._y;
if (who._x > dude._x) {
dude.xvel = dude.xvel - 55;
dude._xscale = 100;
} else {
dude.xvel = dude.xvel + 55;
dude._xscale = -100;
}
dude.hp = dude.hp - amt;
updateHud();
dude.yvel = -20;
if (who.typ == "missile") {
splodeMissile(who);
}
}
if (dude.hp <= 0) {
curmuse.setVolume(0);
var ran = random(2);
player = eval ("hit" + ran);
player.start();
fallsound.start();
lives--;
ultrapause = true;
gameoverwaitcv = 0;
gameoverwait = true;
}
}
}
function finalTalk() {
if (!finaltalkplayed) {
finaltalkplayed = true;
if (dude._x > boss._x) {
dude._xscale = -100;
} else {
dude._xscale = 100;
}
convopointer = -1;
convo = new Array();
convo[0] = new Array("I am undone!", 5);
convo[1] = new Array("The tragedy of our rollercoaster friendship ends with thy untimely death", 1);
convo[2] = new Array("Eat me...", 5);
runConvo(convo);
}
}
function splodeMissile(who) {
screenshake = 25;
makeSplode(who._x, who._y);
hugeBlast(who._x, who._y);
delete who.onEnterFrame;
who.unloadMovie();
who.removeMovieClip();
}
function hugeBlast(x, y) {
flashIt();
var _local1 = effects.attachMovie("hugeblast", "huge" + effcv, effcv);
_local1._xscale = 180;
_local1._yscale = _local1._xscale;
effcv++;
_local1._x = x;
_local1._y = y;
}
function updateLifeColor() {
_root.hud.bguts.bot._xscale = _root.hud.bguts.homescale;
_root.hud.bguts.top._xscale = _root.hud.bguts.homescale;
f0 = new Color(_root.hud.bguts.top);
f0.setRGB(fills[fillpointer]);
f1 = new Color(_root.hud.bguts.bot);
f1.setRGB(fills[fillpointer + 1]);
s0 = new Color(_root.hud.bguts.stroke);
s0.setRGB(strokes[fillpointer]);
if (fillpointer >= 2) {
_root.hud.bguts.bot._xscale = 0;
}
}
function updateHud() {
var _local2 = lives - 1;
_root.hud.guts.wrap.nam.text = "BOMTOONS x" + _local2;
if (dude.hp < 0) {
dude.hp = 0;
}
if (((boss.form == 1) && (boss.hp == boss.maxhp)) && (!startform1)) {
fillpointer = 0;
updateLifeColor();
startform1 = true;
}
if (((boss.form == 2) && (boss.hp == boss.maxhp)) && (!startform2)) {
fillpointer = 1;
updateLifeColor();
startform2 = true;
}
if (((boss.form == 3) && (boss.hp == boss.maxhp)) && (!startform3)) {
fillpointer = 2;
updateLifeColor();
startform3 = true;
}
if (boss.hp < 0) {
boss.hp = 0;
if (boss.form == 1) {
boss.pat = 5;
}
if (boss.form == 2) {
boss.pat = 8;
}
if (boss.form == 3) {
boss.pat = 12;
_root.hud.bguts._visible = false;
_root.hud.guts._visible = false;
}
}
_root.hud.guts.wrap.guts.bar._xscale = (dude.hp / dude.maxhp) * 100;
_root.hud.bguts.top._xscale = (boss.hp / boss.maxhp) * _root.hud.bguts.homescale;
}
function makeSplode(x, y) {
splosion.start();
var _local1 = effects.attachMovie("splode", "splode" + effcv, effcv + 99);
_local1._xscale = 70;
_local1._yscale = _local1._xscale;
effcv++;
_local1._x = x + 5;
_local1._y = y - 100;
}
function makeHitSpark(who) {
if (who._xscale == 100) {
var _local2 = 1;
} else {
var _local2 = -1;
}
var _local1 = effects.attachMovie("spark", "spark" + effcv, effcv + 99);
effcv++;
_local1._x = (who._x + (60 * _local2)) + random(10);
_local1._y = (who._y - 40) - random(10);
_local1._xscale = 100 * _local2;
}
function chkRumble() {
var _local1 = Math.abs(screenshake);
if (_local1 > 0) {
screenshake = -screenshake;
if (screenshake < 0) {
screenshake++;
} else {
screenshake--;
}
}
}
function avalancheIt() {
if (finalrun) {
var _local6 = 0;
while (_local6 < boulders.length) {
var _local4 = boulders[_local6];
if (_local4.hit) {
_local4.recovercv++;
_local4._x = _local4.home + ((7 - _local4.recovercv) * _local4.dir);
_local4.dir = _local4.dir * -1;
if (_local4.recovercv >= 7) {
_local4._x = _local4.home;
_local4.recovercv = 0;
_local4.hit = false;
}
}
if (_local4._currentframe > 1) {
_local4.play();
}
_local6++;
}
var _local7 = avalanche;
_local7.pos = _local7.pos + 4.3;
_local7.cv++;
var _local10 = _root.distmeter;
var _local11 = Math.round(((_local7._x + _local7.pos) + this._x) / 10);
_local10.msg.text = _local11 + " ft.";
if (_local7.cv >= 15) {
var _local8 = _local7.attachMovie("spike", "spike" + effcv, effcv);
effcv++;
spikes.push(_local8);
_local8.yvel = 0;
_local7.cv = 0;
_local8._x = _local7.pos;
var _local9 = random(2);
if (_local9 == 0) {
_local9 = -1;
}
_local8._xscale = _local9 * 100;
_local8.typ = "stalag";
}
for (_local6 in avalanche) {
var _local5 = avalanche[_local6];
if (_local5.typ == "stalag") {
if ((dude._x < _local5._x) && (!gameoverwait)) {
_local5.unloadMovie();
_local5.removeMovieClip();
}
}
}
_local6 = 0;
while (_local6 < spikes.length) {
var _local3 = spikes[_local6];
_local3.virtx = (this._x + _local3._x) + avalanche._x;
_local3.virty = (this._y + _local3._y) + avalanche._y;
if (_local3.virtx <= -750) {
spikes.splice(_local6, 1);
_local3.unloadMovie();
_local3.removeMovieClip();
}
chkSmack(_local3.hitarea, 500, _local3);
if (!_local3.stuck) {
_local3._y = _local3._y + _local3.yvel;
_local3.yvel = _local3.yvel + GRAV;
if (_local3._y >= 450) {
_local3._y = _local3._y + (random(50) + 10);
_local3.cacheAsBitmap = true;
screenshake = 4;
_local3.yvel = 0;
_local3.stuck = true;
}
}
_local6++;
}
}
}
function devices() {
if ((!firststart) && (breakscene)) {
if (dude._x < 1100) {
dude.guts.gotoAndStop("movesword");
dude._xscale = 100;
dude._x = dude._x + 8;
} else {
dude.attacking = false;
dude.guts.gotoAndStop("swordrest");
dude._xscale = -100;
}
}
var allbroke = true;
var i = 0;
while (i < 4) {
var tar = eval ("d" + i);
if (tar.hit) {
tar.recovercv++;
tar._x = tar.home + ((7 - tar.recovercv) * tar.dir);
tar.dir = tar.dir * -1;
if (tar.recovercv >= 7) {
tar._x = tar.home;
tar.recovercv = 0;
tar.hit = false;
}
}
if (!tar.dead) {
allbroke = false;
}
i++;
}
if (allbroke && (!breakscene)) {
bg1.cacheAsBitmap = false;
breakscene = true;
nokeys = true;
bg1.luis.gotoAndPlay("shake");
dude.guts.gotoAndStop("swordrest");
dude.attacking = false;
}
var i = 0;
while (i < walls.length) {
var tar = walls[i];
if (tar.hit) {
tar.recovercv++;
if (tar.recovercv >= 7) {
tar.recovercv = 0;
tar.hit = false;
}
}
i++;
}
}
function runBossEntrance() {
boss.alive = true;
boss.pat = 0;
boss._x = -100;
boss.aicv = 0;
boss.dir = 1;
boss.hp = FORM1LIFE;
boss.maxhp = boss.hp;
hitables.push(boss);
boss.typ = "boss";
boss.hitcv = 0;
boss.form = 1;
}
function flashIt() {
flasher.gotoAndPlay(2);
}
function switchBossForm(num) {
boss.form = num;
var _local2 = new Color(_root.hud.guts.luislife);
_local2.setRGB(barcols[num]);
if (boss.form == 2) {
boss.pat = 6;
_root.runAchieve("Rude awakening");
boss.aicv = 0;
boss.hp = FORM2LIFE;
boss.maxhp = boss.hp;
updateHud();
}
if (boss.form == 3) {
_root.runAchieve("Tighty whitey power");
boss.guts.gotoAndStop("rest3");
boss.pat = 9;
boss.aicv = 0;
boss.hp = FORM3LIFE;
boss.maxhp = boss.hp;
boss.unstickcv = 0;
updateHud();
}
}
function makeAxe(x, y) {
var _local3 = this.effects.attachMovie("axe", "a" + effcv, effcv);
effcv++;
_local3._xscale = 80;
_local3._yscale = _local3._xscale;
_local3._x = x;
_local3._y = y;
_local3.yvel = -25;
_local3.onEnterFrame = function () {
if ((!_root.game.pausy) && (!_root.game.ultrapause)) {
this._y = this._y + this.yvel;
this.yvel = this.yvel + _root.game.GRAV;
_root.game.chkSmack(this.hitarea, 5, this);
if (this._y > 425) {
makeSplode(this._x, this._y);
screenshake = 10;
flashIt();
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
}
};
}
function bossai(who) {
if (!talking) {
if (who.hit) {
who.hitcv++;
var _local8 = 5;
if (who.form == 3) {
_local8 = 7;
}
if (who.hitcv >= _local8) {
who.hit = false;
who.hitcv = 0;
}
}
if (who.pat == 0) {
if (who._x < 650) {
who._x = who._x + 5;
who._xscale = -100;
who.guts.gotoAndStop("walk");
} else {
if (dude._x > boss._x) {
dude._xscale = -100;
} else {
dude._xscale = 100;
}
convopointer = -1;
convo = new Array();
convo[0] = new Array("Who dares disturb the slumber of the great LUIS?", 0);
convo[1] = new Array("It is I, the valiant BOMTOONS, come to end thy tyranny amongst all the Flash community!", 3);
convo[2] = new Array("Thou shalt pay for thine insolence with thy life!", 4);
runConvo(convo);
who.pat = 1;
who.guts.gotoAndStop("rest");
}
}
if (who.pat == 2) {
if (who.aicv < 50) {
if (!who.chargesoundplayed) {
who.chargesoundplayed = true;
chargeup.start();
}
who.guts.gotoAndStop("charge");
}
who.aicv++;
if (who.aicv == 50) {
who.chargesoundplayed = false;
who.guts.gotoAndStop("fireup");
screenshake = 5;
}
if (who.aicv == 80) {
who.guts.gotoAndStop("firemid");
screenshake = 5;
}
if (who.aicv == 110) {
who.guts.gotoAndStop("firelow");
screenshake = 5;
}
if (who.aicv == 140) {
who.pat = 3;
who.bubcv = 0;
who.aicv = 0;
}
}
if (who.pat == 3) {
who.bubcv++;
if (who.bubcv >= 1) {
who.bubcv = 0;
var _local7 = effects.attachMovie("bubblewrap", "bwrap" + effcv, effcv);
effcv++;
var _local10 = who._xscale / 100;
_local7._x = who._x + ((random(250) - 120) - (_local10 * 80));
_local7._y = (who._y - 200) - (random(250) - 125);
}
who.guts.gotoAndStop("stunned");
who.aicv++;
if (who.aicv == 140) {
screenshake = 20;
who.aicv = 0;
who.pat = 4;
}
}
if (who.pat == 4) {
who.guts.gotoAndStop("roll");
if (who.dir == 1) {
if (who._x < 1150) {
who._x = who._x + 35;
} else {
who._xscale = 100;
who.dir = -1;
who.pat = 2;
}
}
if (who.dir == -1) {
if (who._x > 650) {
who._x = who._x - 35;
} else {
who._xscale = -100;
who.dir = 1;
who.pat = 2;
}
}
}
if (who.pat == 5) {
who.guts.gotoAndStop("die1");
}
if (who.pat == 6) {
who.guts.gotoAndStop("laugh");
who.aicv++;
if (who.aicv >= 100) {
who.pat = 7;
who.arrived = false;
who.rollspeed = 10;
}
}
if (who.pat == 7) {
var _local5 = 930;
if (!who.arrived) {
who.guts.gotoAndStop("walk2");
if (who._x > _local5) {
who._xscale = 100;
who._x = who._x - 3;
}
if (who._x < _local5) {
who._xscale = -100;
who._x = who._x + 3;
}
} else if (who.goahead) {
who.aicv++;
var _local9 = (who.hp / who.maxhp) * 100;
if (_local9 < 50) {
who.axecv++;
if (who.axecv >= 40) {
who.axecv = 0;
throwlolli.start();
makeAxe(who._x, who._y - 50);
}
}
who._x = who._x + (who.xdir * who.rollspeed);
who._y = who._y + (who.ydir * who.rollspeed);
if (who._y < 100) {
who._y = 100;
who.ydir = 1;
stompsound.start();
screenshake = 15;
}
if (who._y > 425) {
screenshake = 15;
stompsound.start();
who._y = 425;
who.ydir = -1;
if (who.aicv >= who.rollexpire) {
who.aicv = 0;
who.arrived = false;
who.goahead = false;
}
}
if (who._x > 1350) {
who._x = 1350;
who.xdir = -1;
stompsound.start();
screenshake = 15;
who._xscale = -100;
}
if (who._x < (LEFTSIDE - 100)) {
who._x = LEFTSIDE - 100;
who.xdir = 1;
stompsound.start();
screenshake = 15;
who._xscale = 100;
}
} else {
who.aicv++;
if (who.aicv == 125) {
who.guts.gotoAndStop("roll2");
}
if (who.aicv < 125) {
who.guts.gotoAndStop("laugh");
}
if (who.aicv >= 175) {
who.aicv = 0;
who.rollexpire = 150 + random(100);
if (who.rollspeed < 25) {
who.rollspeed = who.rollspeed + 3;
}
who.axecv = 0;
who.goahead = true;
}
}
if (((who._x > (_local5 - 20)) && (who._x < (_local5 + 20))) && (!who.arrived)) {
who.arrived = true;
who.xdir = random(2);
if (who.xdir == 0) {
who.xdir = -1;
}
who.ydir = -1;
who.aicv = 0;
who.goahead = false;
}
}
if (who.pat == 8) {
who.guts.gotoAndStop("die2");
}
if (who.pat == 9) {
if (!who.hit) {
who.guts.gotoAndStop("retreat");
var _local5 = 890;
if (who._y > 20) {
who._y = who._y - 15;
}
if (who._x > (_local5 + 15)) {
who._x = who._x - 15;
}
if (who._x < (_local5 - 15)) {
who._x = who._x + 15;
}
who.unstickcv++;
if ((who._y <= 20) || (who.unstickcv > 50)) {
if (((who._x > (_local5 - 20)) && (who._x < (_local5 + 20))) || (who.unstickcv > 200)) {
who.guts.gotoAndStop("rest3");
who.pat = 10;
who.aicv = 0;
target = effects.attachMovie("target", "tar" + effcv, effcv);
effcv++;
target._x = who._x;
target._y = 440;
if (missy._x == undefined) {
missiledrop.start();
missy = effects.attachMovie("missile", "missile" + effcv, effcv);
effcv++;
missy._x = who._x;
missy._y = who._y;
missy.timer = 0;
missy.dec = 5;
missy.smokecv = 0;
missy.typ = "missile";
missy.act = false;
missy.yvel = 0;
missy.onEnterFrame = function () {
if ((!_root.game.pausy) && (!_root.game.ultrapause)) {
_root.game.moveMissile(this);
}
};
}
}
}
} else {
who.guts.gotoAndStop("shipstun");
}
}
if (who.pat == 10) {
if (!who.hit) {
who.guts.gotoAndStop("rest3");
who.unstickcv = 0;
var _local11 = dude._x - target._x;
target._x = target._x + (_local11 / 15);
who._x = target._x;
who.aicv++;
if (who.aicv >= 20) {
who.aicv = 0;
who.pat = 11;
target.unloadMovie();
target.removeMovieClip();
}
} else {
who.guts.gotoAndStop("shipstun");
}
}
if (who.pat == 11) {
if (!who.hit) {
if (who._y < 30) {
who.guts.gotoAndStop("armclaw");
} else {
who.pat = 9;
who.aicv = 0;
who.unstickcv = 0;
who.guts.gotoAndStop("retreat");
}
} else {
who.guts.gotoAndStop("shipstun");
}
}
if (who.pat == 12) {
if ((who._y < 440) && (!who.finaldeath)) {
if (!clearitout) {
clearitout = true;
splodeMissile(missy);
for (var _local6 in bricks) {
var _local4 = bricks[_local6];
if (_local4.typ == "brick") {
removeHittable(_local4);
}
}
bosstheme.setVolume(0);
target.unloadMovie();
target.removeMovieClip();
}
nokeys = true;
if (dude._x < 1200) {
dude.guts.gotoAndStop("movesword");
dude._xscale = 100;
dude._x = dude._x + 8;
} else {
dude.guts.gotoAndStop("swordrest");
dude.attacking = false;
dude._xscale = -100;
}
who.guts.gotoAndStop("nosedive");
if (who.guts.guts2._currentframe > 78) {
who._y = who._y + 20;
}
} else if (!who.finaldeath) {
trace("FINAL DEATH");
_root.runAchieve("Stack the deck");
who._y = 415;
who.pat = 13;
finalrun = true;
who.finaldeath = true;
makeSplode(who._x, who._y);
makeSplode(who._x - 20, who._y + 10);
makeSplode(who._x + 20, who._y + 10);
who.guts.gotoAndStop("finaldeath");
}
}
}
}
function startFinal() {
if (!endingstarted) {
endingstarted = true;
_root.hud.gosign.gotoAndPlay(2);
trace("DING DONG!");
changeMusic(finalmusic);
nokeys = false;
this.createEmptyMovieClip("avalanche", 998125);
_root.distmeter._visible = true;
_root.hud.bguts._visible = false;
_root.hud.guts._visible = false;
_root.distmeter.msg.text = "";
avalanche.cv = 0;
avalanche.pos = 450;
spikes = new Array();
screenshake = 40;
RIGHTSIDE = 15000;
walls = new Array();
tilecv = 0;
tilepos = new Array();
var _local3 = new Array(1680, 420);
tilepos.push(_local3);
_local3 = new Array(2100, 0);
tilepos.push(_local3);
_local3 = new Array(3600, 0);
tilepos.push(_local3);
_local3 = new Array(4800, 0);
tilepos.push(_local3);
_local3 = new Array(5900, 0);
tilepos.push(_local3);
_local3 = new Array(8100, 0);
tilepos.push(_local3);
_local3 = new Array(8700, 0);
tilepos.push(_local3);
_local3 = new Array(9300, 0);
tilepos.push(_local3);
_local3 = new Array(9900, 0);
tilepos.push(_local3);
_local3 = new Array(10500, 0);
tilepos.push(_local3);
_local3 = new Array(11100, 0);
tilepos.push(_local3);
_local3 = new Array(12600, 0);
tilepos.push(_local3);
makeTile();
makeTile();
makeTile();
makeTile();
makeTile();
makeTile();
makeTile();
makeTile();
makeTile();
makeTile();
makeTile();
makeTile();
}
}
function makeTile() {
var _local1 = effects.attachMovie("tile" + tilecv, "tile" + effcv, effcv);
effcv++;
_local1._x = tilepos[tilecv][0];
_local1._y = tilepos[tilecv][1];
_local1.hitcv = 0;
walls.push(_local1);
hitables.push(_local1);
_local1.typ = "wall";
_local1 = antiwalk.attachMovie("antitile" + tilecv, "tile" + effcv, effcv);
effcv++;
_local1._x = tilepos[tilecv][0];
_local1._y = tilepos[tilecv][1];
tilecv++;
}
function moveMissile(who) {
if (who.act) {
who.dec++;
_root.game.chkSmack(who.hitarea, 15, who);
if (who.dec >= 5) {
who.dx = dude._x - who._x;
who.dy = (dude._y - 20) - who._y;
length = Math.sqrt((who.dx * who.dx) + (who.dy * who.dy));
who.dx = who.dx / length;
who.dy = who.dy / length;
who.dx = who.dx * 2;
who.dy = who.dy * 2;
angle = Math.atan2(who.dy, who.dx);
who.dr = Math.round((angle * 180) / Math.PI);
who.dec = 0;
}
var _local3 = who.dr - who._rotation;
if (_local3 > 180) {
_local3 = _local3 - 360;
}
if (_local3 < -180) {
_local3 = _local3 + 360;
}
who._rotation = who._rotation + (_local3 / 5);
who._x = who._x + who.dx;
who._y = who._y + who.dy;
who.timer++;
if (who.timer > 350) {
who.guts.gotoAndStop("flash");
if (who.timer > 420) {
splodeMissile(who);
}
}
} else {
who._rotation = 90;
who.yvel = who.yvel + (GRAV * 0.4);
who._y = who._y + who.yvel;
if (who._y > 350) {
who.act = true;
}
}
}
function endBossDrop() {
boss.aicv = 0;
boss.pat = 9;
boss.guts.gotoAndStop("retreat");
boss.unstickcv = 0;
}
function moveBricks() {
if (boss.form == 3) {
var _local7 = 0;
while (_local7 < barr.length) {
var _local3 = barr[_local7];
if (!_local3.landed) {
if ((_local3.yvel > 0) && (!_local3.goneup)) {
_local3.goneup = true;
}
_local3.yvel = _local3.yvel + GRAV;
_local3.virtx = _local3._x + this._x;
_local3.virty = _local3._y + this._y;
var _local2 = _local3;
var _local4 = _local2._y + _local2.yvel;
var _local8 = this;
var _local6 = false;
if (_local3.goneup) {
while (_local2._y < _local4) {
_local2._y++;
_local2.virty++;
while ((_local8.antiwalk.hitTest(_local2.virtx, _local2.virty, true) || (_local8.antiwalk.hitTest(_local2.virtx + 22, _local2.virty, true))) || (_local8.antiwalk.hitTest(_local2.virtx - 22, _local2.virty, true))) {
_local2.yvel = 0;
_local2._y--;
_local2.virty--;
_local4 = _local2._y;
_local6 = true;
}
}
} else {
_local3._y = _local3._y + _local3.yvel;
}
if (_local6 && (_local3.goneup)) {
_local3.landed = true;
_local8 = this;
var _local5 = _local8.antiwalk.attachMovie("bricktop", "btop" + effcv, effcv);
effcv++;
_local5._x = _local3._x;
_local5.cacheAsBitmap = true;
_local5._y = _local3._y;
_local3.hp = 3;
barr.splice(_local7, 1);
_local3.partner = _local5;
_local3.typ = "brick";
if (faller == _local3) {
faller = undefined;
}
}
}
_local7++;
}
}
}
function liquidBrick(x, y, fromship) {
var _local2 = bricks.attachMovie("brickholder", "brick" + effcv, effcv);
effcv++;
_local2._x = x;
_local2._y = y - 2;
_local2.yvel = -3;
_local2.cacheAsBitmap = true;
_local2.typ = "brick";
if (fromship) {
this.faller = _local2;
}
hitables.push(_local2);
barr.push(_local2);
}
function dropBrick() {
brickdrop.start();
liquidBrick(boss._x, boss._y + 120, true);
}
function removePlats() {
var i = 0;
while (i < 4) {
var tar = eval ("d" + i);
tar.unloadMovie();
tar.removeMovieClip();
i++;
}
antiwalk.removers.unloadMovie();
antiwalk.removers.removeMovieClip();
removers.unloadMovie();
removers.removeMovieClip();
}
function makeFireBall(num) {
flashIt();
var _local3 = this.effects.attachMovie("fireball", "fb" + effcv, effcv + 7779);
effcv++;
var _local4 = new Array(-215, -145, -65);
_local3._y = boss._y + _local4[num];
_local3._x = boss._x;
_local3._xscale = boss._xscale * 1.5;
_local3._yscale = Math.abs(_local3._xscale);
if (_local3._xscale == 150) {
_local3.dir = -1;
} else {
_local3.dir = 1;
}
_local3._x = _local3._x + (280 * _local3.dir);
_local3.onEnterFrame = function () {
if ((!_root.game.pausy) && (!_root.game.ultrapause)) {
this._x = this._x + (this.dir * 15);
_root.game.chkSmack(this.hitarea, 5, _root.game.boss);
if ((this._x > 1500) || (this._x < 500)) {
delete this.onEnterFrame;
this.unloadMovie();
this.removeMovieClip();
}
}
};
}
function chkTalkSkip() {
if (!Key.isDown(A)) {
aup = true;
}
if (Key.isDown(A) && (aup)) {
aup = false;
if (convocomplete) {
runConvo();
} else {
var _local2 = _root.talker;
_local2.guts.msg.text = _local2.guts.m;
convocomplete = true;
delete _local2.guts.onEnterFrame;
}
}
}
function runConvo() {
convocomplete = false;
convopointer++;
if (convopointer >= convo.length) {
if (convo[convopointer - 1][0] == "Thou shalt pay for thine insolence with thy life!") {
if (!firststart) {
firststart = true;
screenshake = 20;
boss.pat = 2;
changeMusic(bosstheme);
bosstheme.start(0, 99);
bosstheme.setVolume(40);
_root.hud.gotoAndPlay(2);
nokeys = false;
}
}
if (convo[convopointer - 1][0] == "Eat me...") {
boss.guts.guts2.play();
}
_root.talker.gotoAndPlay("godown");
talking = false;
nokeys = false;
} else {
gleam.start();
runTalk(convo[convopointer][0], convo[convopointer][1]);
}
}
function runTalk(m, picid) {
dude.guts.gotoAndStop("swordrest");
nokeys = true;
talking = true;
var _local5 = _root.talker;
_local5.gotoAndPlay("goup");
_local5.guts.msg.text = "";
_local5.guts.shotyp = "";
_local5.guts.m = m;
_local5.guts.cv = 0;
var _local3 = 0;
while (_local3 < 6) {
var _local4 = _local5.guts.picholder["prev" + _local3];
_local4._visible = false;
_local3++;
}
var _local6 = _local5.guts.picholder["prev" + picid];
_local6._visible = true;
_local5.guts.onEnterFrame = function () {
if ((!_root.game.pausy) && (!_root.game.ultrapause)) {
if (this.cv < this.m.length) {
this.shotyp = this.shotyp + this.m.charAt(this.cv);
this.cv++;
this.msg.text = this.shotyp;
} else {
_root.game.convocomplete = true;
delete this.onEnterFrame;
}
}
};
}
function getShot() {
_root.shot.unloadMovie();
_root.shot.removeMovieClip();
btm.dispose();
var _local3 = _root.createEmptyMovieClip("shot", 911);
btm = new flash.display.BitmapData(700, 450, true, 16777215);
_local3.attachBitmap(btm, 0);
o = _root;
var _local2 = new flash.geom.Matrix();
_local2.tx = 0;
_local2.ty = 0;
_local2.a = 1;
alf = 1;
var _local4 = new flash.geom.ColorTransform(1, 1, 1, alf, 0, 0, 0, 0);
btm.draw(o, _local2, _local4);
_local3.filters = new Array(filter);
}
function removeShot() {
btm.dispose();
_root.shot.unloadMovie();
_root.shot.removeMovieClip();
}
function chkPause() {
if (!Key.isDown(P)) {
pup = true;
}
if (Key.isDown(P) && (pup)) {
pup = false;
if (!pausy) {
pausy = true;
getShot();
_root.pausetxt._visible = true;
_root.pausetxt.swapDepths(992);
boss.guts.guts2.stop();
curmuse.setVolume(0);
} else {
pausy = false;
_root.pausetxt._visible = false;
removeShot();
if (!endingstarted) {
boss.guts.guts2.play();
}
curmuse.setVolume(bgvol);
}
}
}
function runGlow() {
var _local3 = 0;
while (_local3 < 5) {
var _local2 = effects.attachMovie("shiny", "shiny" + effcv, effcv);
effcv++;
_local2._x = (dude._x + random(80)) - 40;
_local2._y = dude._y - random(85);
_local2.xvel = -dude.xvel;
_local2.yvel = 0;
_local2._rotation = random(360);
shinies.push(_local2);
_local3++;
}
_local3 = 0;
while (_local3 < shinies.length) {
var _local1 = shinies[_local3];
_local1._y = _local1._y + _local1.yvel;
_local1.yvel = _local1.yvel - 1;
_local1._x = _local1._x + _local1.xvel;
_local1.xvel = _local1.xvel * 0.9;
_local1._alpha = _local1._alpha - 10;
_local1._rotation = _local1._rotation + 5;
if (_local1._alpha <= 0) {
shinies.splice(_local3, 1);
_local1.unloadMovie();
_local1.removeMovieClip();
}
_local3++;
}
}
function addFlag(who) {
who.actualx = (who._x + who._parent._x) + who._parent._parent._x;
var _local2 = new Array(who.actualx, who, false);
flags.push(_local2);
}
function chkFlags() {
var _local2 = 0;
while (_local2 < flags.length) {
if (flags[_local2][1].firstone && (!flags[_local2][2])) {
flags[_local2][1].gotoAndStop("raise");
this.lastflag = flags[_local2][1];
flags[_local2][2] = true;
}
if ((dude._x > flags[_local2][0]) && (!flags[_local2][2])) {
flags[_local2][1].gotoAndStop("raise");
flags[_local2][2] = true;
this.lastflag = flags[_local2][1];
}
_local2++;
}
}
function respawn() {
shinies = new Array();
fellinpit = false;
squished = false;
dude.xvel = 0;
dude.yvel = -10;
gameoverwaitcv = 0;
curmuse.setVolume(bgvol);
dude.hp = dude.maxhp;
updateHud();
ultrapause = false;
gleam.start();
dude.guts.gotoAndStop("swordrest");
dude.blinking = true;
dude.blinkcv = 0;
this.attachMovie("you", "you", effcv);
effcv++;
you._x = dude._x;
you._y = dude._y;
if (!finalrun) {
dude._x = 880;
dude._y = 350;
} else {
for (i in avalanche) {
var _local2 = avalanche[i];
if (_local2.typ == "stalag") {
_local2.unloadMovie();
_local2.removeMovieClip();
}
}
spikes = new Array();
dude._x = lastflag.actualx;
dude._y = lastflag._y - 150;
avalanche.pos = dude._x - 820;
}
}
function chkQual() {
if (!Key.isDown(81)) {
qup = true;
}
if (Key.isDown(81) && (qup)) {
qup = false;
qpointer++;
if (qpointer > 2) {
qpointer = 0;
}
this._quality = quals[qpointer];
}
}
function addRepel(who) {
repels.push(who);
}
function chkRepels() {
var _local2 = 0;
while (_local2 < repels.length) {
var _local1 = repels[_local2];
while (dude.guts.hitarea.hitTest(_local1)) {
if (_local1.dir == 1) {
dude._x++;
} else {
dude._x--;
}
}
_local2++;
}
}
lives = 3;
updateHud();
_root.fastcv = 0;
clearInterval(this.fastcount);
this.fastcount = setInterval(countUp, 1000);
_root.endtype = "good";
boss.chargesoundplayed = false;
clearitout = false;
firststart = false;
finaltalkplayed = false;
_root.pausetxt._visible = false;
_root.distmeter._visible = false;
ultrapause = false;
endingstarted = false;
FORM1LIFE = 1;
FORM2LIFE = 1;
FORM3LIFE = 1;
FORM1LIFE = 120;
FORM2LIFE = 150;
FORM3LIFE = 20;
this.bgvol = 50;
this.sfvol = 100;
this.bglooper = this.createEmptyMovieClip("bglooper", -50);
this.sfxholder = this.createEmptyMovieClip("sfxholder", -51);
gleam = new Sound(this.sfxholder);
gleam.attachSound("gleam");
chargeup = new Sound(this.sfxholder);
chargeup.attachSound("chargeup");
pound = new Sound(this.sfxholder);
pound.attachSound("pound");
stompsound = new Sound(this.sfxholder);
stompsound.attachSound("stompsound");
bigfireball = new Sound(this.sfxholder);
bigfireball.attachSound("bigfireball");
missiledrop = new Sound(this.sfxholder);
missiledrop.attachSound("missiledrop");
brickdrop = new Sound(this.sfxholder);
brickdrop.attachSound("brickdrop");
spincharge = new Sound(this.sfxholder);
spincharge.attachSound("spincharge");
throwlolli = new Sound(this.sfxholder);
throwlolli.attachSound("throwlolli");
fallsound = new Sound(this.sfxholder);
fallsound.attachSound("fallsound");
hit0 = new Sound(this.sfxholder);
hit0.attachSound("hit0");
hit1 = new Sound(this.sfxholder);
hit1.attachSound("hit1");
swing0 = new Sound(this.sfxholder);
swing0.attachSound("swing0");
swing1 = new Sound(this.sfxholder);
swing1.attachSound("swing1");
swing2 = new Sound(this.sfxholder);
swing2.attachSound("swing2");
splosion = new Sound(this.sfxholder);
splosion.attachSound("splosion1.wav");
groundhit = new Sound(this.sfxholder);
groundhit.attachSound("groundhit");
jumpsound = new Sound(this.sfxholder);
jumpsound.attachSound("jumpsound");
bosstheme = new Sound(this.bglooper);
bosstheme.attachSound("bosstheme");
finalmusic = new Sound(this.bglooper);
finalmusic.attachSound("finalmusic");
introloop = new Sound(this.bglooper);
introloop.attachSound("introloop");
changeMusic(introloop);
finalrun = false;
barcols = new Array("0xFF0000", "0xFFFF00", "0xFFFF00", "0x00CC00");
LEFTSIDE = -1250;
RIGHTSIDE = 1250;
locked = false;
effcv = 0;
antiwalk._alpha = 0;
antiwalk.cacheAsBitmap = true;
bg1.cacheAsBitmap = true;
bg2.cacheAsBitmap = true;
fg.cacheAsBitmap = true;
talking = false;
dude.xvel = 0;
dude.yvel = 0;
dude.sp = 5;
dude.jmpht = 20;
dude.jumpcount = 0;
dude.maxjump = 1;
dude.gotsword = false;
dude.swingcv = 0;
dude.hitcv = 0;
dude.hp = 100;
dude.maxhp = dude.hp;
dude.rebound = 20;
GRAV = 2;
FRIC = 0.5;
dude.atkpointer = 0;
dude.expirecv = 0;
screenshake = 0;
breakscene = false;
boss.finaldeath = false;
barr = new Array();
L = 37;
R = 39;
J = 38;
A = 65;
hitables = new Array();
var i = 0;
while (i < 4) {
var tar = eval ("d" + i);
hitables.push(tar);
tar.typ = "device";
tar.numhits = 1;
tar.recovercv = 0;
i++;
}
boulders = new Array();
_root.hud.bguts.homescale = _root.hud.bguts.top._xscale;
fillpointer = 0;
fills = new Array("0x339900", "0xFFCC00", "0xFF0000");
strokes = new Array("0x1C4301", "0x2B2200", "0x330000");
updateLifeColor();
startform1 = false;
startform2 = false;
startform3 = false;
var matrix = new Array();
matrix = matrix.concat([0.4, 0.4, 0.4, 0, 0]);
matrix = matrix.concat([0.4, 0.4, 0.4, 0, 0]);
matrix = matrix.concat([0.2, 0.2, 0.2, 0, 0]);
matrix = matrix.concat([0, 0, 0, 1, 0]);
var filter = (new flash.filters.ColorMatrixFilter(matrix));
P = 80;
flags = new Array();
var qpointer = 0;
var quals = new Array("High", "Medium", "Low");
this._quality = quals[qpointer];
shinies = new Array();
fellinpit = false;
squished = false;
repels = new Array();
this.onEnterFrame = function () {
chkQual();
if ((!ultrapause) && (!nokeys)) {
chkPause();
}
if (flasher._currentframe > 1) {
flasher.play();
}
if (((!pausy) && (!ultrapause)) || (gameoverwait)) {
avalancheIt();
}
if (((!pausy) && (!ultrapause)) && (!gameoverwait)) {
if (talking) {
chkTalkSkip();
}
if (_root.ultimate && (dude.gotsword)) {
runGlow();
}
if (finalrun) {
chkFlags();
chkRepels();
}
moveBricks();
bossai(boss);
chkRumble();
devices();
chkBonus(dude);
centerOn(dude);
if (!nokeys) {
phys(dude);
controls(dude);
} else {
phys2(dude);
}
}
if (gameoverwait) {
gameoverwaitcv++;
phys(dude);
phys2(dude);
dude.guts.gotoAndStop("dead");
if (gameoverwaitcv == 100) {
if (lives == 0) {
_root.endtype = "bad";
_root.fadeout.gotoAndPlay(2);
} else {
gameoverwaitcv = 150;
}
}
if (gameoverwaitcv >= 170) {
gameoverwait = false;
if (lives <= 0) {
stopAllSounds();
trace("gameover");
_root.endtype = "bad";
clearInterval(this.fastcount);
if (!finalrun) {
_root.gotoAndStop("gameover");
} else {
if (fellinpit) {
_root.gotoAndStop("fallending");
}
if (squished) {
_root.gotoAndStop("smashending");
}
}
} else {
respawn();
}
}
}
};
Symbol 1129 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 1137 MovieClip Frame 1
stop();
Symbol 1157 MovieClip Frame 1
stop();
Symbol 1157 MovieClip Frame 2
trace("got here");
Symbol 1158 MovieClip Frame 1
stop();
Symbol 1158 MovieClip Frame 20
stop();
Symbol 1185 MovieClip Frame 1
stop();
Symbol 1185 MovieClip Frame 12
stop();
Symbol 1187 MovieClip Frame 1
stop();
Symbol 1187 MovieClip Frame 30
stop();
if ((_root.endtype != "bad") && (_root.game.lives > 0)) {
_root.gotoAndStop("goodending");
}
Symbol 1188 MovieClip Frame 21
stop();
Symbol 1194 MovieClip Frame 16
stop();
Symbol 1220 MovieClip Frame 2
function runSkip() {
delete this.onEnterFrame;
_root.gotoAndStop("main");
}
_root.runAchieve("Black Coffin");
aup = false;
this.onEnterFrame = function () {
if (!Key.isDown(65)) {
aup = true;
}
if (Key.isDown(65) && (aup)) {
aup = false;
runSkip();
}
};
Symbol 1220 MovieClip Frame 49
but_again.onPress = function () {
_root.gotoAndStop("game");
};
but_main.onPress = function () {
_root.gotoAndStop("main");
};
but_moregames.onPress = function () {
getURL ("http://www.newgrounds.com/powerofthree2009", "_blank");
};
Symbol 1220 MovieClip Frame 85
stop();
Symbol 1245 MovieClip Frame 2
_root.runAchieve("Abyss-mal");
Symbol 1245 MovieClip Frame 152
stop();
_root.endtype = "bad";
_root.gotoAndStop("credits");
Symbol 1281 MovieClip Frame 2
_root.runAchieve("Grape Crush");
Symbol 1281 MovieClip Frame 196
stop();
_root.endtype = "bad";
_root.gotoAndStop("credits");
Symbol 1341 MovieClip Frame 1
if (_root.fastcv < 200) {
_root.runAchieve("Lou Lou Zoom");
}
this.sex.text = _root.fastcv + " SECONDS";
trace("FAST COUNT: " + _root.fastcv);
_root.fastcv = 0;
Symbol 1341 MovieClip Frame 148
_root.runAchieve("Flee powder");
Symbol 1341 MovieClip Frame 312
stop();
_root.endtype = "good";
_root.gotoAndStop("credits");
Symbol 1346 MovieClip Frame 1
stop();
Symbol 1346 MovieClip Frame 4
stop();
Symbol 1388 MovieClip Frame 1
if (_root.endtype == "good") {
angel._visible = false;
}
Symbol 1393 MovieClip Frame 1
stop();
Symbol 1393 MovieClip Frame 3
stop();
Symbol 1396 MovieClip Frame 1
stop();
Symbol 1396 MovieClip Frame 3
stop();
Symbol 1399 MovieClip Frame 1
stop();
Symbol 1399 MovieClip Frame 3
stop();
Symbol 1402 MovieClip Frame 1
stop();
Symbol 1402 MovieClip Frame 3
stop();
Symbol 1408 MovieClip Frame 1
stop();
Symbol 1408 MovieClip Frame 3
stop();
Symbol 1411 MovieClip Frame 1
stop();
Symbol 1411 MovieClip Frame 3
stop();
Symbol 1415 MovieClip Frame 1
this.onPress = function () {
getURL ("http://www.newgrounds.com/powerofthree2009", "_blank");
};
Symbol 1436 MovieClip Frame 20
stop();
Symbol 1437 MovieClip Frame 25
stop();
Symbol 1441 MovieClip Frame 1
this.onPress = function () {
getURL ("http://www.newgrounds.com/powerofthree2009", "_blank");
};
Symbol 1441 MovieClip Frame 126
stop();
Symbol 1443 MovieClip Frame 1
function runSkip() {
delete this.onEnterFrame;
_root.gotoAndStop("main");
}
aup = false;
but_skip.onPress = function () {
runSkip();
};
this.onEnterFrame = function () {
if (!Key.isDown(65)) {
aup = true;
}
if (Key.isDown(65) && (aup)) {
aup = false;
runSkip();
}
};
if (_root.endtype == "good") {
bg.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 191
if (_root.endtype == "good") {
words.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 392
if (_root.endtype == "good") {
words.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 526
if (_root.endtype == "good") {
bg2.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 588
if (_root.endtype == "good") {
words.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 868
if (_root.endtype == "good") {
words.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 1107
if (_root.endtype == "good") {
words.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 1170
if (_root.endtype == "good") {
words2.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 1525
if (_root.endtype == "good") {
bg3.gotoAndStop("good");
}
Symbol 1443 MovieClip Frame 2725
stop();
_root.gotoAndStop("main");