Frame 1
function onEnterFrame() {
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
percentbytes = int(loadedbytes / (totalbytes / 100));
tb = loadedbytes / totalbytes;
if ((percentbytes == 100) && (!l)) {
l = true;
percent.removeMovieClip();
play();
} else if (!l) {
kbl = loadedbytes / 1024;
kbl = int(kbl * 10) / 10;
tbl = totalbytes / 1024;
tbl = int(tbl * 10) / 10;
percent.clear();
percent.lineStyle(2, 10486017, 100);
percent.beginFill(16711680, 100);
percent.lineTo(tb * 194.1, 0);
percent.lineTo(tb * 194.1, 15);
percent.lineTo(0, 14.3);
percent.endFill();
}
updateAfterEvent();
}
this.createEmptyMovieClip("percent", 1);
percent._x = 478.3;
percent._y = 404.1;
stop();
NewgroundsAPI.connectMovie(125);
var l = false;
Instance of Symbol 9 MovieClip [aglink0] in Frame 1
on (press) {
_root.getURL("http://www.armorgames.com/", "_blank");
}
Frame 4
stop();
intro.onPress = function () {
play();
};
Frame 5
function __rankz_send__(par1, par2, par3, par4) {
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = ab3.rankz.Armor_Bot_30_En_AS1.Encode(par3);
par227.c2NvcmUx = ab3.rankz.Armor_Bot_30_En_AS1.Encode(par4 + "j%e%a%n%s");
par227.flashkey = par227.flashkey.split("=").join("");
par227.SU0249 = par227.SU0249.split("=").join("");
par228.onLoad = function (success) {
if (success) {
trace("win");
trace(par228.msg);
} else {
trace("fail");
trace(par228.loaded);
}
};
par227.sendAndLoad("http://rankz.armorbot.com/submit/", par228, "POST");
}
function initialise() {
muted = false;
day = 1;
totDist = 0;
destDist = 2500;
clk = false;
save = SharedObject.getLocal("plSave");
sounds.push(new Sound());
sounds[0].attachSound("cannon");
sounds.push(new Sound());
sounds[1].attachSound("bomb");
sounds.push(new Sound());
sounds[2].attachSound("waterloop");
sounds.push(new Sound());
sounds[3].attachSound("splash");
sounds.push(new Sound());
sounds[4].attachSound("sandsnd");
sounds.push(new Sound());
sounds[5].attachSound("gull1");
sounds.push(new Sound());
sounds[6].attachSound("gull2");
sounds.push(new Sound());
sounds[7].attachSound("gull3");
sounds.push(new Sound());
sounds[8].attachSound("gold");
sounds.push(new Sound());
sounds[9].attachSound("whale");
sounds.push(new Sound());
sounds[10].attachSound("bite");
music.push(new Sound());
music[0].attachSound("theme");
music.push(new Sound());
music[1].attachSound("menum");
music[1].start(0, 9999);
i = 1;
while (i < 9) {
wtrs.push(new Sound());
wtrs[i - 1].attachSound("water" + i);
i++;
}
this.createEmptyMovieClip("arro", 999);
arro.createEmptyMovieClip("image", 2);
arro.image.attachBitmap(flash.display.BitmapData.loadBitmap("arrow"), 0, "auto", false);
arro.image._x = -64;
arro.image._y = -64;
arro.createEmptyMovieClip("image2", 0);
arro.image2.createEmptyMovieClip("img", 0);
arro.image2.img.attachBitmap(flash.display.BitmapData.loadBitmap("ghost"), 0, "auto", false);
arro.image2.img._x = -64;
arro.image2.img._y = -64;
arro._y = 64;
arro.createTextField("dist", 1, -64, 48, 128, 32);
arro._alpha = 0;
this.createEmptyMovieClip("world", 0);
world.createEmptyMovieClip("clouds", -513);
this.createEmptyMovieClip("back", -514);
this.createEmptyMovieClip("menu", 7);
menu.createEmptyMovieClip("back", 0);
menu.back.attachBitmap(flash.display.BitmapData.loadBitmap("menuback"), 0, "auto", false);
menuBtn("plybtn", 50, "Play").onPress = function () {
gamePaused = false;
menuOpen = false;
sounds[8].start();
music[1].stop("menum");
if ((!musicPlaying) && (!muted)) {
music[0].start(0, 99999);
musicPlaying = true;
}
};
menuBtn("hlpbtn", 100, "Tutorial").onPress = function () {
tutorial = true;
tutpage = 0;
menuOpen = false;
sounds[8].start();
};
menuBtn("scrbtn", 150, "Highscores").onPress = function () {
getURL ("http://rankz.armorbot.com/piratelaunch/", "_blank");
};
menuBtn("spnbtn", 200, "More Great Games").onPress = function () {
getURL ("http://armorgames.com/", "_blank");
};
menuBtn("rstbtn", 250, "Reset Session").onPress = function () {
_root.attachMovie("resetPrompt", "reset", 99999);
};
this.createEmptyMovieClip("buyMenu", 5);
buyMenu.createEmptyMovieClip("back", 0);
buyMenu.back.attachBitmap(flash.display.BitmapData.loadBitmap("buymenu"), 0, "auto", false);
buyMenu._y = -450;
buyMenu.createTextField("goldNo", 2, 115, 25, 192, 32);
buyMenu.createTextField("costNo", 3, 565, 25, 192, 32);
buyMenu.goldNo.selectable = false;
buyMenu.costNo.selectable = false;
buyMenu.currCost = "";
buyMenu.createEmptyMovieClip("scoreShow", 1);
buyMenu.scoreShow.attachBitmap(flash.display.BitmapData.loadBitmap("scores"), 0, "auto", false);
buyMenu.scoreShow._y = 450;
buyMenu.scoreShow.createTextField("best", 1, 96, 5, 64, 32);
buyMenu.scoreShow.createTextField("curr", 2, 96, 35, 64, 32);
menu.createEmptyMovieClip("qual", 99);
menu.createEmptyMovieClip("mute", 100);
menu.qual.attachBitmap(flash.display.BitmapData.loadBitmap("Q"), 0);
menu.qual.onPress = function () {
if (_quality == "LOW") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
} else if (_quality == "HIGH") {
_quality = "LOW";
}
};
menu.mute.attachBitmap(flash.display.BitmapData.loadBitmap("M"), 0);
menu.mute.onPress = function () {
music[1].stop("menum");
if (musicPlaying) {
music[0].stop("theme");
} else if (muted) {
music[0].start(0, 99999);
}
muted = !muted;
musicPlaying = !musicPlaying;
};
menu.qual._x = 668;
menu.mute._x = 668;
menu.qual._y = 418;
menu.mute._y = 386;
menu.attachMovie("aglink0", "aglinkz", 101);
menu.aglinkz._y = 320;
menu.aglinkz.onPress = function () {
getURL ("http://www.armorgames.com/", "_blank");
};
buyMenu.createEmptyMovieClip("msgs", 5);
buyMenu.msgs._x = 350;
buyMenu.msgs._y = 675;
buyMenu.createEmptyMovieClip("cont", 4);
buyMenu.cont.attachBitmap(flash.display.BitmapData.loadBitmap("continuebtn"), 0, "auto", false);
buyMenu.cont._x = 286;
buyMenu.cont._y = 416;
buyMenu.cont.onPress = function () {
submitted = false;
pirate.removeProjectile();
save.data.cash = gold;
save.data.items = currItems;
save.data.won = won;
save.data.hasWon = hasWon;
save.data.day = day;
buyMode = false;
gamePaused = false;
boyancy = ItemInfo.masts[currItems[2]][0] / 2;
waterResist = ItemInfo.ships[currItems[1]][0];
cannon.base = flash.display.BitmapData.loadBitmap("base" + currItems[4]);
cannon.barrel = flash.display.BitmapData.loadBitmap("cannon1");
cannon.updateGraphics();
cannon.minPower = ItemInfo.cannons[currItems[4]][0];
cannon.maxPower = ItemInfo.cannons[currItems[4]][1];
sounds[8].start();
if (((((currItems[0] == 4) && (currItems[1] == 4)) && (currItems[2] == 4)) && (currItems[3] == 4)) && (currItems[4] == 4)) {
scored.upgradeBtn.removeMovieClip();
}
};
buyMenu.createEmptyMovieClip("mmbtn", 1337);
buyMenu.mmbtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
buyMenu.mmbtn.createTextField("txt", 1, 0, 4, 270, 40);
buyMenu.mmbtn.txt.text = "MAIN MENU";
fmt.size = 24;
fmt.color = 16777215 /* 0xFFFFFF */;
buyMenu.mmbtn.txt.setTextFormat(fmt);
buyMenu.mmbtn.txt.embedFonts = true;
buyMenu.mmbtn.txt.selectable = false;
buyMenu.mmbtn.onPress = function () {
_root.attachMovie("menuPrompt", "reset", 99999);
};
buyMenu.mmbtn._y = 410;
buyMenu.createEmptyMovieClip("spbtn", 1338);
buyMenu.spbtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
buyMenu.spbtn.createTextField("txt", 1, 0, 4, 270, 40);
buyMenu.spbtn.txt.text = "MORE GREAT GAMES";
fmt.size = 24;
fmt.color = 16777215 /* 0xFFFFFF */;
buyMenu.spbtn.txt.setTextFormat(fmt);
buyMenu.spbtn.txt.embedFonts = true;
buyMenu.spbtn.txt.selectable = false;
buyMenu.spbtn.onPress = function () {
_root.getURL("http://www.armorgames.com/", "_blanck");
};
buyMenu.spbtn._x = 430;
buyMenu.spbtn._y = 410;
fmt.size = 32;
fmt.color = 16763904 /* 0xFFCC00 */;
this.createEmptyMovieClip("prog", -512);
this.prog.attachBitmap(flash.display.BitmapData.loadBitmap("progress"), 0, "auto", false);
this.prog._x = 412;
this.prog._y = 0;
this.prog.createTextField("day", 1, 80, 64, 128, 32);
this.prog.day.embedFonts = true;
this.prog.day.selectable = false;
this.prog.day.text = "Day 1";
fmt.color = 16777215 /* 0xFFFFFF */;
this.prog.day.setTextFormat(fmt);
fmt.color = 16763904 /* 0xFFCC00 */;
this.createEmptyMovieClip("progShip", -511);
this.progShip.attachBitmap(flash.display.BitmapData.loadBitmap("prog"), 0, "auto", false);
this.createEmptyMovieClip("scored", 6);
scored.createEmptyMovieClip("image", 0);
scored.image.attachBitmap(flash.display.BitmapData.loadBitmap("scored"), 0, "auto", false);
scored.createEmptyMovieClip("upgradeBtn", 1);
scored.createEmptyMovieClip("submitBtn", 2);
scored.createEmptyMovieClip("menuBtn", 3);
scored.createEmptyMovieClip("contBtn", 4);
scored.createTextField("entNam", 5, 215, 160, 270, 40);
scored.entNam.type = "input";
scored.entNam.text = "Enter Name Here";
scored.border = true;
scored.upgradeBtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
scored.submitBtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
scored.menuBtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
scored.contBtn.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0, "auto", false);
scored.upgradeBtn.createTextField("txt", 1, 0, 4, 270, 40);
scored.submitBtn.createTextField("txt", 1, 0, 4, 270, 40);
scored.menuBtn.createTextField("txt", 1, 0, 4, 270, 40);
scored.contBtn.createTextField("txt", 1, 0, 4, 270, 40);
txtFmt3 = new TextFormat();
txtFmt3.size = 32;
txtFmt3.color = 16777215 /* 0xFFFFFF */;
txtFmt3.align = "center";
txtFmt3.bold = true;
txtFmt3.font = "Pieces of Eight";
scored.createTextField("currscore", scored.getNextHighestDepth(), 215, 117, 270, 40);
scored.currscore.selectable = false;
scored.upgradeBtn.txt.text = "UPGRADE MENU";
scored.submitBtn.txt.text = "SUBMIT HIGHSCORE";
scored.menuBtn.txt.text = "MAIN MENU";
scored.contBtn.txt.text = "CONTINUE";
fmt.size = 24;
fmt.color = 16777215 /* 0xFFFFFF */;
scored.upgradeBtn.txt.setTextFormat(fmt);
scored.upgradeBtn.txt.embedFonts = true;
scored.submitBtn.txt.setTextFormat(fmt);
scored.submitBtn.txt.embedFonts = true;
scored.menuBtn.txt.setTextFormat(fmt);
scored.menuBtn.txt.embedFonts = true;
scored.contBtn.txt.setTextFormat(fmt);
scored.contBtn.txt.embedFonts = true;
fmt.size = 32;
fmt.color = 16763904 /* 0xFFCC00 */;
scored.upgradeBtn.txt.selectable = false;
scored.submitBtn.txt.selectable = false;
scored.menuBtn.txt.selectable = false;
scored.contBtn.txt.selectable = false;
scored.upgradeBtn.onPress = function () {
gamePaused = true;
buyMode = true;
scoredShow = false;
sounds[8].start();
};
scored.submitBtn.onPress = function () {
if (!submitted) {
submitted = true;
gamePaused = true;
sounds[8].start();
bXlnYW1lX25hbWVfdmFyaWFibGU = scored.entNam.text;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = Math.floor(pirate.distance / 100);
__rankz_send__("MzY1M2olZSVhJW4lcw==", "b0dUdW14eWs=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
}
};
scored.menuBtn.onPress = function () {
_root.attachMovie("menuPrompt", "reset", 99999);
};
scored.contBtn.onPress = function () {
submitted = false;
pirate.removeProjectile();
save.data.cash = gold;
save.data.items = currItems;
save.data.won = won;
save.data.hasWon = hasWon;
save.data.day = day;
buyMode = false;
gamePaused = false;
boyancy = ItemInfo.masts[currItems[2]][0] / 2;
waterResist = ItemInfo.ships[currItems[1]][0];
cannon.base = flash.display.BitmapData.loadBitmap("base" + currItems[4]);
cannon.barrel = flash.display.BitmapData.loadBitmap("cannon1");
cannon.updateGraphics();
cannon.minPower = ItemInfo.cannons[currItems[4]][0];
cannon.maxPower = ItemInfo.cannons[currItems[4]][1];
sounds[8].start();
if (((((currItems[0] == 4) && (currItems[1] == 4)) && (currItems[2] == 4)) && (currItems[3] == 4)) && (currItems[4] == 4)) {
scored.upgradeBtn.removeMovieClip();
}
};
scored.upgradeBtn._x = 215;
scored.submitBtn._x = 215;
scored.menuBtn._x = 215;
scored.contBtn._x = 215;
scored.upgradeBtn._y = 205;
scored.submitBtn._y = 250;
scored.menuBtn._y = 295;
scored.contBtn._y = 340;
scored._y = -450;
scoredShow = false;
txtFmt = new TextFormat();
txtFmt.size = 16;
txtFmt.color = 16777215 /* 0xFFFFFF */;
txtFmt.font = "arial";
txtFmt.bold = true;
txtFmt2 = new TextFormat();
txtFmt2.size = 20;
txtFmt2.color = 16777215 /* 0xFFFFFF */;
txtFmt2.font = "arial";
txtFmt2.bold = true;
txtFmt2.align = "center";
buyMenu.scoreShow.best.text = 0;
buyMenu.scoreShow.curr.text = 0;
buyMenu.scoreShow.best.setTextFormat(txtFmt);
buyMenu.scoreShow.curr.setTextFormat(txtFmt);
var _local4 = 0;
while (_local4 < 4) {
var _local3 = 0;
while (_local3 < 5) {
buyMenu[(("btn_" + _local4) + "_") + _local3] = new BuyButton(_local4, _local3);
_local3++;
}
_local4++;
}
back.attachBitmap(flash.display.BitmapData.loadBitmap("backdrop"), 0, "auto", false);
world.createEmptyMovieClip("water", 4);
cloud1 = new CloudObject();
cloud2 = new CloudObject();
splashArr = new Array();
splashes = 0;
controls = new Array();
controls[0] = [65, 68];
controls[1] = [37, 39];
scapeDown = false;
waterLevel = 386;
airResist = 0;
waterResist = 0.02;
gravity = 0.5;
boyancy = 0.5;
currItems = [1, 1, 1, 1, 1];
cannon = new CannonObject("can_mc", 1);
mouseAngle = 0;
holdClick = false;
gamePaused = true;
menuOpen = true;
gold = 0;
if (save.data.cash == undefined) {
save.data.cash = 0;
save.data.items = [1, 1, 1, 1, 1];
save.data.won = false;
save.data.hasWon = false;
save.data.day = 1;
} else {
gold = save.data.cash;
currItems = save.data.items;
won = save.data.won;
hasWon = save.data.hasWon;
day = save.data.day;
}
tutpage = 0;
buyMode = false;
cannon.minAngle = -75;
cannon.maxAngle = -15;
cannon.minPower = ItemInfo.cannons[currItems[4]][0];
cannon.power = 0;
cannon.maxPower = ItemInfo.cannons[currItems[4]][1];
shipAngleMax = 45;
cannon.mc._x = 64;
cannon.mc._y = 350;
cannon.base = flash.display.BitmapData.loadBitmap("base" + currItems[4]);
cannon.barrel = flash.display.BitmapData.loadBitmap("cannon1");
cannon.updateGraphics();
this.createEmptyMovieClip("sea", 1);
sea.attachBitmap(flash.display.BitmapData.loadBitmap("sea"), 0, "auto", false);
sea._y = waterLevel;
someListener = new Object();
someListener.onMouseDown = function () {
if (!gamePaused) {
holdClick = true;
}
clk = true;
};
someListener.onMouseUp = function () {
holdClick = false;
clk = false;
};
Mouse.addListener(someListener);
this.createEmptyMovieClip("tutor", this.getNextHighestDepth());
tutor._x = 700;
i = 0;
while (i < 8) {
tutor.createEmptyMovieClip("p" + i, i);
tutor["p" + i].attachBitmap(flash.display.BitmapData.loadBitmap("tut" + (i + 1)), 0);
tutor["p" + i]._x = i * 700;
i++;
}
tutor.onEnterFrame = function () {
if (tutorial) {
tutor._x = tutor._x + (((tutpage * -700) - tutor._x) * 0.1);
if (tutpage != 0) {
tutor.hlp._x = tutor.hlp._x + (((tutpage * 700) - tutor.hlp._x) * 0.1);
} else {
tutor.hlp.text = "CLICK TO CONTINUE";
fmt.color = 16777215 /* 0xFFFFFF */;
tutor.hlp.setTextFormat(fmt);
fmt.color = 16763904 /* 0xFFCC00 */;
tutor.hlp.embedFonts = true;
}
if (tutpage == 7) {
tutor.hlp._y = tutor.hlp._y + ((250 - tutor.hlp._y) * 0.1);
tutor.hlp.text = "CLICK TO PLAY";
fmt.color = 16777215 /* 0xFFFFFF */;
tutor.hlp.setTextFormat(fmt);
fmt.color = 16763904 /* 0xFFCC00 */;
tutor.hlp.embedFonts = true;
}
} else {
tutor._x = tutor._x + ((700 - tutor._x) * 0.1);
tutor.hlp._x = 0;
tutor.hlp._y = 410;
}
};
tutor.onPress = function () {
sounds[8].start();
tutpage++;
if (tutpage == 8) {
tutpage = 0;
tutorial = false;
gamePaused = false;
tutor._x = 700;
music[1].stop();
if (!musicPlaying) {
music[0].start(0, 99999);
musicPlaying = true;
}
}
};
tutor.createTextField("hlp", 8, 0, 410, 700, 50);
tutor.hlp.text = "CLICK TO CONTINUE";
tutor.hlp.setTextFormat(fmt);
tutor.hlp.embedFonts = true;
world.attachMovie("ireland", "goal", world.getNextHighestDepth());
world.goal._y = 400;
world.goal._x = destDist * 100;
}
function win() {
if (!won) {
world.goal.removeMovieClip();
this.attachMovie("Outro", "outro", this.getNextHighestDepth());
won = true;
}
}
function menuBtn(nam, yy, txt) {
menu.createEmptyMovieClip(nam, menu.getNextHighestDepth());
var mc = menu[nam];
mc.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0);
mc._x = 400;
mc._y = yy;
mc.createTextField("lbl", 1, 0, 0, 270, 40);
mc.lbl.text = txt;
fmt.color = 16777215 /* 0xFFFFFF */;
mc.lbl.setTextFormat(fmt);
fmt.color = 16763904 /* 0xFFCC00 */;
mc.lbl.embedFonts = true;
mc.onRollOver = function () {
mc.attachBitmap(flash.display.BitmapData.loadBitmap("button2"), 0);
};
mc.onRollOut = function () {
mc.attachBitmap(flash.display.BitmapData.loadBitmap("button1"), 0);
};
return(mc);
}
function onEnterFrame() {
mouseAngle = Math.atan2(_ymouse - cannon.mc._y, _xmouse - cannon.mc._x);
mouseAngle = (mouseAngle / Math.PI) * 180;
if ((!pirate.active) && (!gamePaused)) {
cannon.rotateBarrel(mouseAngle);
}
rotSpeed = new Number();
rotSpeed = (Key.isDown(controls[0][1]) || (Key.isDown(controls[1][1]))) - (Key.isDown(controls[0][0]) || (Key.isDown(controls[1][0])));
rotSpeed = rotSpeed * ItemInfo.wheels[currItems[3]][0];
if (!gamePaused) {
cloud1.moveCloud();
cloud2.moveCloud();
pirate.moveProjectile(rotSpeed);
pirate.onSand = false;
i = 0;
while (i < obstacles.length) {
obstacles[i].checkHit(pirate.mc, pirate);
i++;
}
i = obstacles.length;
if (holdClick && (!pirate.active)) {
cannon.power = cannon.power + cannon.inc;
if (cannon.power < cannon.minPower) {
cannon.power = cannon.minPower;
cannon.inc = 1;
} else if (cannon.power > cannon.maxPower) {
cannon.power = cannon.maxPower;
cannon.inc = -1;
}
} else if (((!holdClick) && (!pirate.active)) && (cannon.power >= cannon.minPower)) {
i = 0;
while (i < obstacles.length) {
obstacles[i].mc.removeMovieClip();
i++;
}
i = 0;
while (i < splashArr.length) {
splashArr[i].mc.removeMovieClip();
i++;
}
obstacles = new Array();
splashArr = new Array();
canx = cannon.mc._x + (Math.cos((cannon.angle * Math.PI) / 180) * 64);
cany = cannon.mc._y + (Math.sin((cannon.angle * Math.PI) / 180) * 64);
pirate = new ProjectileObject("proj", new flash.geom.Point(canx, cany), cannon.angle, cannon.power, 0);
pirate.bitmap1 = flash.display.BitmapData.loadBitmap("pirate" + currItems[0]);
pirate.bitmap2 = flash.display.BitmapData.loadBitmap("mast" + currItems[2]);
pirate.bitmap3 = flash.display.BitmapData.loadBitmap("ship" + currItems[1]);
pirate.updateGraphics();
lastDist = -700;
cannon.power = 0;
sounds[0].start();
} else if (pirate.active) {
updateProg((pirate.mc._x + totDist) / (destDist * 100));
if (pirate.mc._y < 0) {
arro._x = pirate.mc._x + world._x;
arro.image2._rotation = pirate.mc._rotation;
arro.dist.text = -Math.floor(pirate.mc._y / 10);
arro.dist.setTextFormat(txtFmt2);
} else {
arro.dist.text = "";
}
buyMenu.scoreShow.best.text = Math.floor(pirate.mc._x / 100);
buyMenu.scoreShow.best.setTextFormat(txtFmt);
cannon.fireCannon();
if (pirate.mc._x > ((lastDist + 500) + (Math.random() * 250))) {
if ((Math.random() < 0.5) || (lastDist == -700)) {
if ((Math.random() < 0.33) || (lastDist == -700)) {
effectArr = new Array(4);
effectArr[0] = [(16 * Math.random()) + 8, 0, 0];
effectArr[1] = [0, ((8 * Math.random()) - 12) * ItemInfo.masts[currItems[2]][0], (Math.random() * 4) - 2];
effectArr[2] = [0, 0, 0];
effectArr[3] = 0;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 700, _root.waterLevel + 24), effectArr, world.getNextHighestDepth());
obstacles[i].bitmap = flash.display.BitmapData.loadBitmap("obstacle4");
obstacles[i].updateGraphics();
i++;
} else if (Math.random() < 0.5) {
effectArr = new Array(4);
effectArr[0] = [(8 * Math.random()) + 4, 0, 0];
effectArr[1] = [0, ((8 * Math.random()) - 12) * ItemInfo.masts[currItems[2]][0], (Math.random() * 4) - 2];
effectArr[2] = [0, 0, 0];
effectArr[3] = 0;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 700, _root.waterLevel - ((Math.random() * 256) + 64)), effectArr, world.getNextHighestDepth());
obstacles[i].bitmap = flash.display.BitmapData.loadBitmap("seagul1");
obstacles[i].gull = true;
obstacles[i].updateGraphics();
i++;
} else {
effectArr = new Array(4);
effectArr[0] = [0, 0, 0];
effectArr[1] = [0, ((8 * Math.random()) - 24) * ItemInfo.masts[currItems[2]][0], (Math.random() * 6) - 3];
effectArr[2] = [0, 0, 0];
effectArr[3] = 0;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 700, _root.waterLevel + 24), effectArr, world.getNextHighestDepth());
obstacles[i].bitmap = flash.display.BitmapData.loadBitmap("obstacle5");
obstacles[i].whale = true;
obstacles[i].updateGraphics();
i++;
}
} else if (Math.random() < (1 - ItemInfo.pirates[currItems[0]][1])) {
effectArr = new Array(4);
effectArr[0] = [0, 0, 0];
effectArr[1] = [0, 0, 0];
effectArr[2] = [0, 0, 0];
effectArr[3] = 2;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 700, (Math.random() * 100) + 250), effectArr, world.getNextHighestDepth());
i++;
} else if (Math.random() < 0.25) {
effectArr = new Array(4);
effectArr[0] = [0, 0, 0];
effectArr[1] = [0, ((2 * Math.random()) - 4) * ItemInfo.masts[currItems[2]][0], (Math.random() * 6) - 3];
effectArr[2] = [0.75, 0, 0];
effectArr[3] = 0;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 900, _root.waterLevel), effectArr, world.getNextHighestDepth());
obstacles[i].shark = true;
i++;
} else if (Math.random() < 0.5) {
effectArr = new Array(4);
effectArr[0] = [0, 0, 0];
effectArr[1] = [0, -2, 0];
effectArr[2] = [0.9, 0, 0];
effectArr[3] = 1;
obstacles[i] = new ObstacleObject("obst" + i, new flash.geom.Point(pirate.mc._x + 900, _root.waterLevel), effectArr, world.getNextHighestDepth());
obstacles[i].bitmap = flash.display.BitmapData.loadBitmap("obstacle" + String(Math.floor(Math.random() * 3) + 1));
obstacles[i].updateGraphics();
i++;
}
lastDist = pirate.mc._x;
}
if (!hasWon) {
if ((pirate.mc._x + 25) > (destDist * 100)) {
pirate.xspeed = pirate.xspeed * 0.9;
}
if ((pirate.mc._x - 50) > (destDist * 100)) {
}
var _local2 = new flash.geom.Point(pirate.mc._x, pirate.mc._y);
world.localToGlobal(_local2);
if (world.goal.hitTest(_local2.x, _local2.y + 16, true)) {
pirate.xspeed = 0;
pirate.yspeed = 0;
pirate.mc._rotation = -30;
pirate.won = true;
}
}
}
j = 0;
while (j < splashArr.length) {
splashArr[j].fadeWater(j);
j++;
}
pirate.mc.swapDepths(world.getNextHighestDepth());
world.water.swapDepths(world.getNextHighestDepth());
}
if (buyMode) {
buyMenu.currCost = "";
buyMenu.currGold = gold;
buyMenu.scoreShow.curr.text = gold;
buyMenu._y = buyMenu._y + ((-buyMenu._y) * 0.1);
if (buyMenu._y > -2) {
buyMenu._y = 0;
}
xx = 0;
while (xx < 4) {
yy = 0;
while (yy < 5) {
buyMenu[(("btn_" + xx) + "_") + yy].checkClick(_xmouse, _ymouse - buyMenu._y, clk);
yy++;
}
xx++;
}
buyMenu.goldNo.text = buyMenu.currGold;
buyMenu.costNo.text = buyMenu.currCost;
buyMenu.goldNo.setTextFormat(txtFmt);
if (buyMenu.currCost > buyMenu.currGold) {
txtFmt.color = 13369344 /* 0xCC0000 */;
}
buyMenu.costNo.setTextFormat(txtFmt);
txtFmt.color = 16777215 /* 0xFFFFFF */;
} else {
buyMenu._y = buyMenu._y + ((-450 - buyMenu._y) * 0.1);
if (buyMenu._y < -448) {
buyMenu._y = -450;
}
if (pirate.active) {
buyMenu.scoreShow.curr.text = gold + Math.floor(pirate.distance / 100);
} else {
buyMenu.scoreShow.curr.text = gold;
}
}
if (buyMenu.scoreShow.curr.text == "NaN") {
buyMenu.scoreShow.curr.text = 0;
}
buyMenu.scoreShow.curr.setTextFormat(txtFmt);
if (scoredShow) {
scored.entNam.setTextFormat(fmt);
scored._y = scored._y + ((-scored._y) * 0.1);
if (scored._y > -2) {
scored._y = 0;
es = Number(scored.currscore.text);
ts = Math.floor(pirate.distance / 100);
if (es < ts) {
scored.currscore.text = Math.ceil(es + ((ts - es) / 8));
if (nxtnse <= 0) {
nxtnse = 4;
sounds[8].start();
}
}
nxtnse--;
}
scored.currscore.setTextFormat(txtFmt3);
} else {
scored._y = scored._y + ((-450 - scored._y) * 0.1);
if (scored._y < -448) {
scored._y = -450;
}
}
if (menuOpen) {
menu._y = menu._y + ((-menu._y) * 0.1);
if (menu._y > -2) {
menu._y = 0;
}
if (Key.isDown(27)) {
if (!scapeDown) {
menuOpen = false;
if (!buyMode) {
gamePaused = false;
}
}
scapeDown = true;
} else {
scapeDown = false;
}
} else {
menu._y = menu._y + ((-450 - menu._y) * 0.1);
if (menu._y < -448) {
menu._y = -450;
}
if (Key.isDown(27)) {
if ((!scapeDown) && (!gamePaused)) {
menuOpen = true;
gamePaused = true;
}
scapeDown = true;
} else {
scapeDown = false;
}
}
}
function updateProg(rat) {
if (hasWon) {
this.prog._alpha = 0;
this.progShip._alpha = 0;
} else {
this.prog._alpha = 100;
this.progShip._alpha = 100;
}
var _local2 = rat * 45;
if (!rat) {
_local2 = 0;
}
_local2 = _local2 - 22.5;
_local2 = _local2 - 90;
_local2 = (_local2 * Math.PI) / 180;
var _local3 = new flash.geom.Point(Math.cos(_local2) * 256, Math.sin(_local2) * 256);
_local3 = _local3.add(new flash.geom.Point(554, 298));
_local3 = _local3.add(new flash.geom.Point(-12, -12));
this.progShip._x = _local3.x;
this.progShip._y = _local3.y;
this.progShip._rotation = ((_local2 / Math.PI) * 180) + 90;
}
stop();
var txtFmt;
var txtFmt3;
var cloud1;
var cloud2;
var splashArr;
var splashes;
var controls;
var scapeDown;
var clk;
var won;
var hasWon;
var submitted;
var save;
var waterLevel;
var airResist;
var waterResist;
var gravity;
var boyancy;
var currItems;
var totDist;
var destDist;
var day;
var muted;
var pirate;
var cannon;
var mouseAngle;
var obstacles;
var msgs;
var lastDist;
var holdClick;
var gamePaused;
var menuOpen;
var gold;
var scoredShow;
var buyMode;
var tutorial;
var tutpage;
var nxtnse;
var shipAngleMax;
var someListener;
var sounds = new Array();
var music = new Array();
var wtrs = new Array();
var fmt = new TextFormat();
fmt.size = 32;
fmt.font = "Pieces of Eight";
fmt.align = "center";
fmt.color = 16763904 /* 0xFFCC00 */;
var bla = new TextFormat();
bla.size = 24;
bla.font = "Pieces of Eight";
bla.align = "center";
bla.color = 16763904 /* 0xFFCC00 */;
var musicPlaying = false;
initialise();
updateProg(0);
Frame 6
prevFrame();
Symbol 30 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 36 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 38 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 368 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var _local2 = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!stat_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + stat_name);
}
}
static function addCustomLink(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!stat_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = CUSTOM_STATS + stat_id;
SendMessage((("Created custom link " + stat_id) + ": ") + stat_name);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var _local1 = {page:special};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(event_name) {
if (!event_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[event_name]) {
SendError("Attempted to log undefined custom event: " + event_name);
} else {
SendEvent(custom_events[event_name]);
}
}
static function loadCustomLink(link_name) {
if (!link_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[link_name]) {
SendError("Attempted to open undefined custom link: " + link_name);
} else {
SendLink(custom_links[link_name]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
for (var _local2 in params) {
params[_local2] = unescape(params[_local2]);
movie_options[_local2] = params[_local2];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url);
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(_local4);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id;
for (var _local9 in extra) {
_local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(extra[_local9]));
}
trace(_local7);
if (debug) {
_local7 = _local7 + "&debug=1";
}
if (open_in_browser) {
getURL (_local7, "_blank");
} else {
var _local10 = new XML();
_local10.ignoreWhite = true;
_local10.onLoad = function (success) {
var _local6 = new Object();
var _local3 = 0;
while (_local3 < this.firstChild.childNodes.length) {
var _local4 = this.firstChild.childNodes[_local3];
var _local5 = _local4.nodeName;
var _local2 = _local4.attributes.value;
if (_local2 == Number(_local2)) {
_local2 = Number(_local2);
}
_local6[_local5] = _local2;
_local3++;
}
NewgroundsAPI.ReadGatewayData(_local6);
};
_local10.load(_local7);
}
}
}
static function SendError(msg) {
trace("[NEWGROUNDS API ERROR] :: " + msg);
}
static function SendMessage(msg) {
trace("[NEWGROUNDS API] :: " + msg);
}
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 onNewVersionAvailable(version, movie_url, redirect_url) {
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 " + version) + " is now available at:") + newline;
var _local5 = _local3.length;
_local3 = _local3 + 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 = redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
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 " + hostname) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + 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 = redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 369 MovieClip [__Packages.ItemInfo] Frame 0
class ItemInfo
{
function ItemInfo () {
}
static var pirates = ["", [1, 0.8], [0.75, 0.6], [0.5, 0.4], [0.25, 0.2]];
static var ships = ["", [0.075, 0, 0.03], [0.05, 4, 0.02], [0.025, 8, 0.01], [0.01, 16, 0]];
static var masts = ["", [1], [1.25], [1.5], [1.75]];
static var wheels = ["", [0.2], [0.3], [0.4], [0.5]];
static var cannons = ["", [4, 24, 204, 204, 204], [6, 32, 40, 119, 138], [8, 40, 31, 31, 31], [10, 48, 1, 38, 186]];
static var costs = [[0, 200, 600, 1800], [0, 175, 525, 1575], [0, 150, 450, 1350], [0, 125, 375, 1125], [0, 100, 300, 900]];
static var buyPositions = [[187, 280, 372, 465], [52, 128, 204, 279, 355]];
}
Symbol 370 MovieClip [__Packages.ObstacleObject] Frame 0
class ObstacleObject
{
var mc, trueEffects, xspeedInc, xspeedAbs, xspeedMul, yspeedInc, yspeedAbs, yspeedMul, rspeedInc, rspeedAbs, rspeedMul, rabs, cabs, origy, hit, hitB, bitmap;
function ObstacleObject (instName, startPosition, effects, depth) {
_root.world.createEmptyMovieClip(instName, depth);
mc = _root.world[instName];
mc.createEmptyMovieClip("image", 0);
mc._x = startPosition.x;
mc._y = startPosition.y;
trueEffects = new Array(3);
trueEffects[0] = [effects[0][0] != 0, effects[0][1] != 0, effects[0][2] != 0];
trueEffects[1] = [effects[1][0] != 0, effects[1][1] != 0, effects[1][2] != 0];
trueEffects[2] = [effects[2][0] != 0, effects[2][1] != 0, effects[2][2] != 0];
xspeedInc = effects[0][0];
xspeedAbs = effects[1][0];
xspeedMul = effects[2][0];
yspeedInc = effects[0][1];
yspeedAbs = effects[1][1];
yspeedMul = effects[2][1];
rspeedInc = effects[0][2];
rspeedAbs = effects[1][2];
rspeedMul = effects[2][2];
rabs = ((effects[3] == 1) ? 1 : 0);
cabs = ((effects[3] == 2) ? 1 : 0);
origy = mc._y - 16;
hit = false;
hitB = false;
}
function updateGraphics() {
mc.image.attachBitmap(bitmap, 0, "auto", false);
mc.image._x = -(mc.image._width / 2);
mc.image._y = 64 - mc.image._height;
}
function checkHit(objMc, objVar) {
if (!hit) {
if (mc._x > ((-_root.world._x) - 64)) {
if (cabs) {
animFrame++;
if (animFrame > 17) {
animFrame = 1;
}
bitmap = flash.display.BitmapData.loadBitmap("coin" + Math.floor(animFrame));
updateGraphics();
}
if (gull) {
animFrame++;
if (animFrame > 12) {
animFrame = 1;
}
bitmap = flash.display.BitmapData.loadBitmap("seagul" + Math.floor(animFrame));
mc._xscale = 50;
mc._yscale = 50;
if (mc._y < origy) {
yspeed = yspeed + 0.5;
} else {
yspeed = yspeed - 0.5;
}
mc._y = mc._y + yspeed;
updateGraphics();
}
if (whale) {
if (mc._y < origy) {
yspeed = yspeed + 0.25;
} else {
yspeed = yspeed - 0.25;
}
mc._y = mc._y + yspeed;
}
if (shark) {
animFrame++;
if (animFrame > 8) {
animFrame = 1;
}
bitmap = flash.display.BitmapData.loadBitmap("shark" + Math.floor(animFrame));
updateGraphics();
}
var _local6 = Math.sqrt(Math.pow(objMc._x - mc._x, 2) + Math.pow((objMc._y + 16) - mc._y, 2));
if (rabs) {
if ((objMc._y + 16) < (mc._y - 16)) {
_local6 = 64;
}
} else if (cabs) {
_local6 = Math.sqrt(Math.pow(objMc._x - mc._x, 2) + Math.pow((objMc._y - 16) - mc._y, 2));
_local6 = _local6 * 0.5;
}
if (_local6 < 64) {
if (trueEffects[0][0]) {
objVar.xspeed = objVar.xspeed + xspeedInc;
}
if (trueEffects[1][0]) {
objVar.xspeed = xspeedAbs;
}
if (trueEffects[2][0]) {
objVar.xspeed = objVar.xspeed * xspeedMul;
}
if (trueEffects[0][1]) {
objVar.yspeed = objVar.yspeed + yspeedInc;
}
if (trueEffects[1][1]) {
objVar.yspeed = yspeedAbs;
}
if (trueEffects[2][1]) {
objVar.yspeed = objVar.yspeed * yspeedMul;
}
if (trueEffects[0][2]) {
objVar.rspeed = objVar.rspeed + rspeedInc;
}
if (trueEffects[1][2]) {
objVar.rspeed = rspeedAbs;
}
if (trueEffects[2][2]) {
objVar.rspeed = objVar.rspeed * rspeedMul;
}
if (rabs != 0) {
objMc._rotation = objMc._rotation + ((-objMc._rotation) * 0.5);
objVar.onSand = true;
if (!hitB) {
hitB = true;
_root.sounds[4].start();
}
objMc._y = mc._y - 24;
} else {
if (cabs) {
_root.sounds[8].start();
_root.pirate.distance = _root.pirate.distance + 2500;
splodeFrame = 16;
var _local3 = 0;
while (_local3 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, mc._y), 8, true));
_local3++;
}
mc.removeMovieClip();
} else if (gull) {
_root.sounds[Math.floor(Math.random() * 3) + 5].start();
_root.pirate.distance = _root.pirate.distance + 1000;
var _local3 = 0;
while (_local3 < 8) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, mc._y), 8, false));
_root.splashArr[_root.splashArr.length - 1].fe = true;
_local3++;
}
} else if (whale) {
_root.sounds[9].start();
_root.pirate.distance = _root.pirate.distance + 1000;
var _local3 = 0;
while (_local3 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, _root.waterLevel), 12, false));
_local3++;
}
} else if (shark) {
_root.sounds[10].start();
_root.pirate.distance = _root.pirate.distance - 2500;
if (_root.pirate.distance < 0) {
_root.pirate.distance = 0;
}
var _local3 = 0;
while (_local3 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, _root.waterLevel), 12, true));
_local3++;
}
yspeed = -4;
mc._rotation = 45;
} else {
_root.pirate.distance = _root.pirate.distance + 1000;
_root.sounds[1].start();
var _local3 = 0;
while (_local3 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, _root.waterLevel), 12, false));
_local3++;
}
}
hit = true;
}
}
} else {
hit = true;
_root.obstacleArr.splice(0, 1);
mc.removeMovieClip();
}
} else if ((((splodeFrame < 16) && (!gull)) && (!whale)) && (!shark)) {
splodeFrame = splodeFrame + 0.75;
bitmap = flash.display.BitmapData.loadBitmap("explosion" + Math.round(splodeFrame));
updateGraphics();
} else if ((splodeFrame < 10) && (gull)) {
splodeFrame = splodeFrame + 0.75;
bitmap = flash.display.BitmapData.loadBitmap("gullhit" + Math.round(splodeFrame));
mc._y = mc._y + 4;
updateGraphics();
} else if (gull) {
mc._y = mc._y + 4;
if (mc._x > ((-_root.world._x) - 64)) {
_root.obstacleArr.splice(0, 1);
mc.removeMovieClip();
}
} else if (whale || (shark)) {
if (shark) {
mc._y = mc._y + yspeed;
yspeed = yspeed + 0.5;
if (mc._rotation > -90) {
mc._rotation = mc._rotation - 4;
}
} else {
mc._y = mc._y + 4;
}
if (mc._x <= ((-_root.world._x) - 64)) {
_root.obstacleArr.splice(0, 1);
mc.removeMovieClip();
}
}
}
var splodeFrame = 0;
var animFrame = 1;
var gull = false;
var whale = false;
var shark = false;
var yspeed = 0;
}
Symbol 371 MovieClip [__Packages.ProjectileObject] Frame 0
class ProjectileObject
{
var onSand, mc, won, maxAngle, xspeed, yspeed, distance, rspeed, active, stopTimer, lastRot, alive, bitmap1, bitmap2, bitmap3, nurot;
function ProjectileObject (instName, startPosition, startAngle, startSpeed, depth) {
onSand = false;
_root.world.createEmptyMovieClip(instName, depth);
mc = _root.world[instName];
mc.createEmptyMovieClip("image", 0);
mc.image.createEmptyMovieClip("pirate", 1);
mc.image.createEmptyMovieClip("mast", 0);
mc.image.createEmptyMovieClip("ship", 2);
won = false;
mc._x = startPosition.x;
mc._y = startPosition.y;
mc._rotation = startAngle;
maxAngle = _root.shipAngleMax;
xspeed = Math.cos((startAngle * Math.PI) / 180) * startSpeed;
yspeed = Math.sin((startAngle * Math.PI) / 180) * startSpeed;
distance = 0;
rspeed = 0;
active = true;
stopTimer = 0;
lastRot = 0;
alive = true;
}
function updateGraphics() {
mc.image.pirate.attachBitmap(bitmap1, 0, "auto", false);
if ((_root.currItems[1] != 1) || (_root.currItems[2] != 1)) {
mc.image.mast.attachBitmap(bitmap2, 0, "auto", false);
}
mc.image.ship.attachBitmap(bitmap3, 0, "auto", false);
var _local3 = ItemInfo.ships[_root.currItems[1]][1];
mc.image.mast._x = 32;
mc.image.mast._y = -64 - _local3;
mc.image.pirate._x = 48;
mc.image.pirate._y = 16 - _local3;
mc.image._x = -64;
mc.image._y = -48;
}
function moveProjectile(angleAdd) {
if (active) {
if (xspeed > 32) {
xspeed = xspeed + ((32 - xspeed) * 0.1);
}
rspeed = rspeed + angleAdd;
if (rspeed > 8) {
rspeed = 8;
} else if (rspeed < -8) {
rspeed = -8;
}
mc._rotation = mc._rotation + rspeed;
if (((mc._y + 16) < (_root.waterLevel + 16)) && ((mc._y + 16) > (_root.waterLevel - 16))) {
var _local5 = Math.floor(Math.sqrt(((xspeed * xspeed) * 0.125) + ((yspeed * yspeed) * 0.125)));
if (Math.random() < (xspeed / 32)) {
_root.wtrs[Math.floor(Math.random() * 8)].start();
}
var _local3 = 0;
while (_local3 < _local5) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point((mc._x + 32) + (Math.cos((mc._rotation * Math.PI) / 180) * -16), _root.waterLevel), 6, false));
_local3++;
}
}
if ((mc._y + 16) < _root.waterLevel) {
xspeed = xspeed * (1 - _root.airResist);
yspeed = yspeed * (1 - _root.airResist);
if (!won) {
yspeed = yspeed + _root.gravity;
}
lastRot = lastRot + rspeed;
} else {
var _local6 = Math.sqrt(mc._rotation * mc._rotation);
_local6 = _local6 / 180;
if ((mc._rotation < maxAngle) && (mc._rotation > (-maxAngle))) {
if ((lastRot >= 180) || (lastRot <= -180)) {
nurot = Math.sqrt(Math.pow(lastRot, 2));
nurot = nurot + 180;
distance = distance + (5000 * Math.floor(nurot / 360));
_root.sounds[8].start();
var _local4 = 0;
while (_local4 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, mc._y), 8, true));
_local4++;
}
if (lastRot >= 180) {
_root.msgs.push(new HudMsg("flip1"));
} else {
_root.msgs.push(new HudMsg("flip2"));
}
}
if (lastRot != 0) {
lastRot = 0;
}
rspeed = rspeed + ((_local6 * (xspeed / 8)) * ItemInfo.pirates[_root.currItems[0]][0]);
yspeed = yspeed * (1 - _root.waterResist);
if ((yspeed > 0) && (!((mc._rotation > 175) || (mc._rotation < -175)))) {
yspeed = yspeed * (-_root.boyancy);
mc._y = _root.waterLevel - 16;
}
} else {
if (alive) {
_root.sounds[3].start(0.1);
var _local4 = 0;
while (_local4 < 24) {
_root.splashArr.push(new WaterSplash(new flash.geom.Point(mc._x, mc._y), 8, false));
_local4++;
}
alive = false;
}
if (mc._rotation > 0) {
rspeed = (180 - mc._rotation) * 0.05;
} else {
rspeed = (-180 - mc._rotation) * 0.05;
}
yspeed = yspeed + 0.5;
xspeed = xspeed * 0.9;
}
xspeed = xspeed * (1 - _root.waterResist);
}
if (xspeed < 0.25) {
stopTimer++;
if (stopTimer > 24) {
_root.gold = _root.gold + Math.round(distance / 100);
stopTimer = 0;
active = false;
_root.gamePaused = true;
if ((mc._x > ((_root.destDist * 100) - 50)) && (!_root.hasWon)) {
stopAllSounds();
_root.win();
_root.hasWon = true;
} else if (!_root.hasWon) {
mc._x = 0;
_root.day++;
_root.prog.day.text = "Day " + _root.day;
_root.fmt.color = 16777215 /* 0xFFFFFF */;
_root.prog.day.setTextFormat(_root.fmt);
_root.fmt.color = 16763904 /* 0xFFCC00 */;
_root.buyMode = true;
} else {
_root.scoredShow = true;
_root.scored.currscore.text = 0;
_root.nxtnse = 4;
}
}
} else {
stopTimer = 0;
}
mc._x = mc._x + xspeed;
mc._y = mc._y + yspeed;
distance = distance + xspeed;
if ((mc._x > 350) && ((mc._x < ((_root.destDist * 100) + 300)) || (_root.hasWon))) {
_root.world._x = _root.world._x + ((((-mc._x) + 350) - _root.world._x) * 0.25);
} else if ((mc._x > 350) && (!_root.hasWon)) {
_root.world._x = _root.world._x + (((((_root.destDist * 100) - mc._x) + 300) - _root.world._x) * 0.25);
}
if (mc._y < 0) {
_root.arro._alpha = (-mc._y) / 2;
if (_root.arro._alpha > 100) {
_root.arro._alpha = 100;
}
} else {
_root.arro._alpha = 0;
}
} else {
_root.world._x = _root.world._x + ((-_root.world._x) * 0.25);
_root.world._y = _root.world._y + ((-_root.world._y) * 0.25);
}
}
function removeProjectile() {
active = false;
mc.removeMovieClip();
}
}
Symbol 372 MovieClip [__Packages.WaterSplash] Frame 0
class WaterSplash
{
var life, radius, mc, xspeed, yspeed;
function WaterSplash (position, speedMult, coins) {
_root.splashes++;
life = (Math.random() * 25) + 75;
if (!coins) {
radius = (Math.random() * 25) + 25;
} else {
radius = (Math.random() * 50) + 25;
}
var _local3 = "spl" + _root.splashes;
_root.world.water.createEmptyMovieClip(_local3, _root.world.water.getNextHighestDepth());
mc = _root.world.water[_local3];
mc.createEmptyMovieClip("image", 0);
if (coins) {
mc.image.attachBitmap(flash.display.BitmapData.loadBitmap("coin"), 0, "auto", false);
} else if (!_root.pirate.onSand) {
mc.image.attachBitmap(flash.display.BitmapData.loadBitmap("water"), 0, "auto", false);
} else {
mc.image.attachBitmap(flash.display.BitmapData.loadBitmap("sand"), 0, "auto", false);
}
mc._xscale = (mc._yscale = radius);
mc._alpha = life;
mc.image._x = -(radius / 2);
mc.image._y = -(radius / 2);
mc._x = position.x;
mc._y = position.y;
xspeed = ((Math.random() * speedMult) * 2) - speedMult;
yspeed = -(Math.random() * speedMult);
}
function fadeWater(index) {
if (!_root.gamePaused) {
if (fe) {
if (mc._y < _root.waterLevel) {
yspeed = yspeed + (_root.gravity / 4);
}
if (!fea) {
mc.image.attachBitmap(flash.display.BitmapData.loadBitmap("feather"), 0, "auto", false);
mc._xscale = 200;
mc._yscale = 200;
mc._rotation = Math.random() * 360;
fea = true;
}
} else if (mc._y < _root.waterLevel) {
yspeed = yspeed + _root.gravity;
}
life = life - 4;
mc._alpha = life;
mc._x = mc._x + xspeed;
mc._y = mc._y + yspeed;
if ((life <= 0) || (mc._y >= _root.waterLevel)) {
mc.removeMovieClip();
_root.splashArr.splice(index, 1);
}
}
}
var fe = false;
var fea = false;
}
Symbol 373 MovieClip [__Packages.HudMsg] Frame 0
class HudMsg
{
function HudMsg (bitmap) {
var mc;
var _local2 = _root.buyMenu.msgs.getNextHighestDepth();
_root.buyMenu.msgs.createEmptyMovieClip("msg" + _local2, _local2);
mc = _root.buyMenu.msgs["msg" + _local2];
mc.attachBitmap(flash.display.BitmapData.loadBitmap(bitmap), 0);
mc._x = (-mc._width) / 2;
mc._y = (-mc._height) / 2;
mc.onEnterFrame = function () {
if (mc._alpha <= 0) {
mc.removeMovieClip();
return(undefined);
}
mc._y = mc._y - 1;
mc._alpha = mc._alpha - 1;
};
}
}
Symbol 374 MovieClip [__Packages.CannonObject] Frame 0
class CannonObject
{
var mc, format, inc, fireCount, barrel, base, maxAngle, angle, minAngle, power, minPower, maxPower;
function CannonObject (instName, depth) {
_root.world.createEmptyMovieClip(instName, depth);
mc = _root.world[instName];
mc.createTextField("angl", 3, 4, -24, 32, 32);
mc.angl.selectable = false;
format = new TextFormat();
format.color = 16777215 /* 0xFFFFFF */;
format.font = "arial";
mc.createEmptyMovieClip("barrel", 0);
mc.barrel.createEmptyMovieClip("image", 1);
mc.createEmptyMovieClip("ff", 4);
mc.ff.createEmptyMovieClip("fire", 0);
mc.createEmptyMovieClip("base", 2);
mc.base.createEmptyMovieClip("bitmap", 0);
mc.createEmptyMovieClip("powerDisp", 1);
inc = 1;
fireCount = 13;
}
function updateGraphics() {
mc.barrel.image.removeMovieClip();
mc.barrel.createEmptyMovieClip("image", 1);
mc.base.image.removeMovieClip();
mc.base.createEmptyMovieClip("image", 0);
var _local6 = new flash.geom.Transform(mc.barrel);
var _local4 = ItemInfo.cannons[_root.currItems[4]][2];
var _local5 = ItemInfo.cannons[_root.currItems[4]][3];
var _local7 = ItemInfo.cannons[_root.currItems[4]][4];
var _local3 = new flash.geom.ColorTransform(1, 1, 1, 1, -_local4, -_local5, -_local7, 0);
_local6.colorTransform = _local3;
mc.barrel.image.attachBitmap(barrel, 0, "auto", false);
mc.base.image.attachBitmap(base, 0, "auto", false);
mc.barrel.image._x = -32;
mc.barrel.image._y = -64;
mc.barrel._x = 16;
mc.base.image._x = -64;
mc.base.image._y = -64;
mc.powerDisp._x = -36;
mc.powerDisp._y = 16;
}
function updateFire(no) {
mc.ff.fire.removeMovieClip();
mc.ff.createEmptyMovieClip("fire", 4);
mc.ff.fire._x = 64;
mc.ff.fire._y = -32;
mc.ff._x = 16;
mc.ff._rotation = mc.barrel._rotation;
mc.ff.fire.attachBitmap(flash.display.BitmapData.loadBitmap("fire" + no), 0);
}
function rotateBarrel(inputAngle) {
if (inputAngle > maxAngle) {
angle = maxAngle;
} else if (inputAngle < minAngle) {
angle = minAngle;
} else {
angle = inputAngle;
}
mc.angl.text = Math.round(-angle);
mc.angl.setTextFormat(format);
mc.barrel._rotation = mc.barrel._rotation + ((angle - mc.barrel._rotation) * 0.25);
mc.powerDisp.clear();
mc.powerDisp.moveTo(0, 0);
mc.powerDisp.beginFill(3355443, 100);
mc.powerDisp.lineTo(98, 0);
mc.powerDisp.lineTo(98, 12);
mc.powerDisp.lineTo(0, 12);
mc.powerDisp.endFill();
if (power > 0) {
mc.powerDisp.moveTo(0, 0);
mc.powerDisp.beginFill(13382451, 100);
mc.powerDisp.lineTo(((power - minPower) / (maxPower - minPower)) * 98, 0);
mc.powerDisp.lineTo(((power - minPower) / (maxPower - minPower)) * 98, 12);
mc.powerDisp.lineTo(0, 12);
mc.powerDisp.endFill();
barrel = flash.display.BitmapData.loadBitmap("cannon" + Math.ceil((((power - minPower) / (maxPower - minPower)) * 4) + 1));
fireCount = 1;
updateGraphics();
}
}
function fireCannon() {
if (Math.round(fireCount) < 13) {
if (Math.round(fireCount) < 7) {
barrel = flash.display.BitmapData.loadBitmap("cannon" + Math.round(fireCount + 5));
}
updateFire(Math.round(fireCount));
updateGraphics();
fireCount = fireCount + 0.75;
} else if (Math.round(fireCount) == 13) {
mc.ff.fire.removeMovieClip();
fireCount++;
}
}
}
Symbol 375 MovieClip [__Packages.BuyButton] Frame 0
class BuyButton
{
var xx, yy, mc, fmt, fmt2, bitmap;
function BuyButton (xpos, ypos) {
xx = xpos;
yy = ypos;
var _local3 = "btn" + _root.buyMenu.getNextHighestDepth();
_root.buyMenu.createEmptyMovieClip(_local3, _root.buyMenu.getNextHighestDepth());
mc = _root.buyMenu[_local3];
mc._x = ItemInfo.buyPositions[0][xx];
mc._y = ItemInfo.buyPositions[1][yy];
mc.createTextField("cost", 1, 4, 36, 48, 16);
mc.cost.text = "Owned";
mc.cost.selectable = false;
fmt = new TextFormat();
fmt.font = "arial";
fmt.size = 12;
fmt.color = 16777215 /* 0xFFFFFF */;
fmt.align = "right";
fmt.bold = true;
fmt2 = new TextFormat();
fmt2.font = "arial";
fmt2.size = 12;
fmt2.color = 16711680 /* 0xFF0000 */;
fmt2.align = "right";
fmt2.bold = true;
}
function checkClick(mouseX, mouseY, mouseC) {
if (((_root.gold < ItemInfo.costs[yy][xx]) && (_root.currItems[yy] == xx)) || (_root.currItems[yy] < xx)) {
bitmap = flash.display.BitmapData.loadBitmap("menubtn2");
mc.attachBitmap(bitmap, 0);
if ((((mouseX > mc._x) && (mouseX < (mc._x + 56))) && (mouseY > mc._y)) && (mouseY < (mc._y + 56))) {
_root.buyMenu.currCost = ItemInfo.costs[yy][xx];
}
mc.cost.text = ItemInfo.costs[yy][xx];
mc.cost.setTextFormat(fmt2);
} else if ((_root.gold >= ItemInfo.costs[yy][xx]) && (_root.currItems[yy] == xx)) {
mc.cost.text = ItemInfo.costs[yy][xx];
mc.cost.setTextFormat(fmt);
if ((((mouseX > mc._x) && (mouseX < (mc._x + 56))) && (mouseY > mc._y)) && (mouseY < (mc._y + 56))) {
bitmap = flash.display.BitmapData.loadBitmap("menubtn4");
mc.attachBitmap(bitmap, 0);
_root.buyMenu.currCost = ItemInfo.costs[yy][xx];
if (mouseC) {
_root.gold = _root.gold - _root.buyMenu.currCost;
_root.buyMenu.currGold = _root.gold;
_root.currItems[yy] = xx + 1;
}
} else {
bitmap = flash.display.BitmapData.loadBitmap("menubtn1");
mc.attachBitmap(bitmap, 0);
}
} else {
bitmap = flash.display.BitmapData.loadBitmap("menubtn3");
mc.attachBitmap(bitmap, 0);
mc.cost.text = "Owned";
mc.cost.setTextFormat(fmt);
}
}
}
Symbol 376 MovieClip [__Packages.ab3.rankz.Armor_Bot_30_En_AS1] Frame 0
class ab3.rankz.Armor_Bot_30_En_AS1 extends Object
{
static var _CharsReverseLookup;
var _Armor_Bot_30_En_AS1Str, _Armor_Bot_30_En_AS1Count;
function Armor_Bot_30_En_AS1 () {
super();
}
static function Encode(str) {
var _local1 = new ab3.rankz.Armor_Bot_30_En_AS1();
return(_local1.encodeArmor_Bot_30_En_AS1(str));
}
static function Decode(str) {
var _local1 = new ab3.rankz.Armor_Bot_30_En_AS1();
return(_local1.decodeArmor_Bot_30_En_AS1(str));
}
static function StringReplaceAll(source, find, replacement) {
return(source.split(find).join(replacement));
}
static function InitReverseChars() {
_CharsReverseLookup = new Array();
var _local1 = 0;
while (_local1 < _Chars.length) {
_CharsReverseLookup[_Chars[_local1]] = _local1;
_local1++;
}
return(true);
}
static function UrlDecode(str) {
str = StringReplaceAll(str, "\\", " ");
str = unescape(str);
return(str);
}
static function UrlEncode(str) {
str = escape(str);
str = StringReplaceAll(str, "\\", "%2B");
str = StringReplaceAll(str, "%20", "+");
return(str);
}
function setArmor_Bot_30_En_AS1Str(str) {
_Armor_Bot_30_En_AS1Str = str;
_Armor_Bot_30_En_AS1Count = 0;
}
function readArmor_Bot_30_En_AS1() {
if (!_Armor_Bot_30_En_AS1Str) {
return(_EndOfInput);
}
if (_Armor_Bot_30_En_AS1Count >= _Armor_Bot_30_En_AS1Str.length) {
return(_EndOfInput);
}
var _local2 = _Armor_Bot_30_En_AS1Str.charCodeAt(_Armor_Bot_30_En_AS1Count) & 255;
_Armor_Bot_30_En_AS1Count++;
return(_local2);
}
function encodeArmor_Bot_30_En_AS1(str) {
setArmor_Bot_30_En_AS1Str(str);
var _local3 = "";
var _local2 = new Array(3);
var _local5 = 0;
var _local4 = false;
while ((!_local4) && (((_local2[0] = readArmor_Bot_30_En_AS1())) != _EndOfInput)) {
_local2[1] = readArmor_Bot_30_En_AS1();
_local2[2] = readArmor_Bot_30_En_AS1();
_local3 = _local3 + _Chars[_local2[0] >> 2];
if (_local2[1] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[0] << 4) & 48) | (_local2[1] >> 4)];
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[1] << 2) & 60) | (_local2[2] >> 6)];
_local3 = _local3 + _Chars[_local2[2] & 63];
} else {
_local3 = _local3 + _Chars[(_local2[1] << 2) & 60];
_local3 = _local3 + "=";
_local4 = true;
}
} else {
_local3 = _local3 + _Chars[(_local2[0] << 4) & 48];
_local3 = _local3 + "=";
_local3 = _local3 + "=";
_local4 = true;
}
_local5 = _local5 + 4;
if (_local5 >= 76) {
_local3 = _local3 + newline;
_local5 = 0;
}
}
return(_local3);
}
function readReverseArmor_Bot_30_En_AS1() {
if (!_Armor_Bot_30_En_AS1Str) {
return(_EndOfInput);
}
while (true) {
if (_Armor_Bot_30_En_AS1Count >= _Armor_Bot_30_En_AS1Str.length) {
return(_EndOfInput);
}
var _local2 = _Armor_Bot_30_En_AS1Str.charAt(_Armor_Bot_30_En_AS1Count);
_Armor_Bot_30_En_AS1Count++;
if (_CharsReverseLookup[_local2]) {
return(_CharsReverseLookup[_local2]);
}
if (_local2 == "A") {
return(0);
}
}
}
function ntos(n) {
var _local1 = n.toString(16);
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
_local1 = "%" + _local1;
return(unescape(_local1));
}
function decodeArmor_Bot_30_En_AS1(str) {
setArmor_Bot_30_En_AS1Str(str);
var _local3 = "";
var _local2 = new Array(4);
var _local4 = false;
while (((!_local4) && (((_local2[0] = readReverseArmor_Bot_30_En_AS1())) != _EndOfInput)) && (((_local2[1] = readReverseArmor_Bot_30_En_AS1())) != _EndOfInput)) {
_local2[2] = readReverseArmor_Bot_30_En_AS1();
_local2[3] = readReverseArmor_Bot_30_En_AS1();
_local3 = _local3 + ntos(((_local2[0] << 2) & 255) | (_local2[1] >> 4));
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[1] << 4) & 255) | (_local2[2] >> 2));
if (_local2[3] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[2] << 6) & 255) | _local2[3]);
} else {
_local4 = true;
}
} else {
_local4 = true;
}
}
return(_local3);
}
function toHex(n) {
var _local4 = "";
var _local3 = true;
var _local1 = 32;
while (_local1 > 0) {
_local1 = _local1 - 4;
var _local2 = (n >> _local1) & 15;
if ((!_local3) || (_local2 != 0)) {
_local3 = false;
_local4 = _local4 + _Digits[_local2];
}
}
return(((_local4 == "") ? "0" : (_local4)));
}
function pad(str, len, pad) {
var _local2 = str;
var _local1 = str.length;
while (_local1 < len) {
_local2 = pad + _local2;
_local1++;
}
return(_local2);
}
function encodeHex(str) {
var _local4 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local4 = _local4 + pad(toHex(str.charCodeAt(_local2) & 255), 2, "0");
_local2++;
}
return(_local4);
}
function decodeHex(str) {
var _local5 = "";
var _local3 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local3 = _local3 + str.charAt(_local2);
if (_local3.length == 2) {
_local5 = _local5 + ntos(parseInt("0x" + _local3));
_local3 = "";
}
_local2++;
}
return(_local5);
}
static var _EndOfInput = -1;
static var _Chars = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/");
static var _CharsReverseLookupInited = InitReverseChars();
static var _Digits = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
}
Symbol 377 MovieClip [__Packages.CloudObject] Frame 0
class CloudObject
{
var isle, mc, bitmap;
function CloudObject () {
isle = false;
var _local3 = "cloud" + _root.world.clouds.getNextHighestDepth();
_root.world.clouds.createEmptyMovieClip(_local3, _root.world.clouds.getNextHighestDepth());
mc = _root.world.clouds[_local3];
if (!isle) {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 6) + 1));
} else {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 4) + 7));
}
mc.attachBitmap(bitmap, 0, "auto", false);
mc._x = Math.random() * 700;
if (!isle) {
mc._y = Math.random() * 200;
mc._alpha = 100;
} else {
mc._y = _root.waterLevel - 64;
mc._alpha = 33;
}
}
function moveCloud() {
if (mc._x < ((-_root.world._x) - 192)) {
isle = Boolean(Math.round(Math.random()));
if (!isle) {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 6) + 1));
} else {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 4) + 7));
}
mc.attachBitmap(bitmap, 0, "auto", false);
mc._x = (-_root.world._x) + 700;
mc._x = mc._x + (Math.random() * 700);
if (!isle) {
mc._y = Math.random() * 200;
mc._alpha = 100;
} else {
mc._y = _root.waterLevel - 64;
mc._alpha = 33;
}
} else if (mc._x > ((-_root.world._x) + 700)) {
isle = Boolean(Math.round(Math.random()));
if (!isle) {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 6) + 1));
} else {
bitmap = flash.display.BitmapData.loadBitmap("cloud" + (Math.floor(Math.random() * 4) + 7));
}
mc.attachBitmap(bitmap, 0, "auto", false);
mc._x = (-_root.world._x) - 192;
mc._x = mc._x - (Math.random() * 700);
if (!isle) {
mc._y = Math.random() * 200;
mc._alpha = 100;
} else {
mc._y = _root.waterLevel - 64;
mc._alpha = 33;
}
}
}
}
Symbol 200 MovieClip Frame 1
stop();
Symbol 229 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local4 = sX / this._width;
var _local3 = sY / this._height;
_parent._x = cX - (this._x * _local4);
_parent._y = cY - (this._y * _local3);
_parent._xscale = 100 * _local4;
_parent._yscale = 100 * _local3;
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
parentColor.setTransform(camColor.getTransform());
this.screen._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
this.onUnload = resetStage;
Instance of Symbol 229 MovieClip "vcam" in Symbol 264 MovieClip [Outro] Frame 1
onClipEvent (enterFrame) {
_y = (_y + ((_root.screen_._y - _y) / 1));
_x = (_x + ((_root.screen_._x - _x) / 1));
this.score = 0;
}
Symbol 264 MovieClip [Outro] Frame 770
_root.pirate.won = false;
_root.scoredShow = true;
_root.scored.currscore.text = 0;
_root.nxtnse = 4;
_root.day++;
if (_root.musicPlaying) {
_root.music[0].start(0, 99999);
}
this.removeMovieClip();
Symbol 271 Button
on (press) {
_root.buyMode = false;
_root.menuOpen = true;
_root.scoredShow = false;
_root.reset.removeMovieClip();
}
Symbol 273 Button
on (press) {
_root.reset.removeMovieClip();
}
Symbol 278 Button
on (press) {
_root.save.data.cash = 0;
_root.save.data.items = [1, 1, 1, 1, 1];
_root.save.data.won = false;
_root.save.data.hasWon = false;
_root.save.data.day = 1;
_root.won = false;
_root.hasWon = false;
_root.day = 1;
_root.prog.day.text = "Day " + _root.day;
_root.fmt.color = 16777215 /* 0xFFFFFF */;
_root.prog.day.setTextFormat(_root.fmt);
_root.fmt.color = 16763904 /* 0xFFCC00 */;
_root.gold = 0;
_root.currItems = [1, 1, 1, 1, 1];
_root.pirate.distance = 0;
if (_root.pirate.active) {
_root.pirate.removeProjectile();
}
_root.buyMode = false;
_root.boyancy = ItemInfo.masts[_root.currItems[2]][0] / 2;
_root.waterResist = ItemInfo.ships[_root.currItems[1]][0];
_root.cannon.base = flash.display.BitmapData.loadBitmap("base" + _root.currItems[4]);
_root.cannon.barrel = flash.display.BitmapData.loadBitmap("cannon1");
_root.cannon.updateGraphics();
_root.cannon.minPower = ItemInfo.cannons[_root.currItems[4]][0];
_root.cannon.maxPower = ItemInfo.cannons[_root.currItems[4]][1];
_root.buyMenu.scoresShow.best.text = 0;
_root.buyMenu.scoresShow.curr.text = 0;
_root.sounds[8].start();
_root.reset.removeMovieClip();
}
Symbol 291 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 294 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 294 MovieClip Frame 218
_root.nextFrame();
Symbol 352 Button
on (release) {
getURL ("http://goat-man.newgrounds.com", "_blank");
}
Symbol 356 Button
on (release) {
getURL ("http://stalin98.newgrounds.com", "_blank");
}
Symbol 360 Button
on (release) {
getURL ("http://www.newgrounds.com/audio/listen/1795", "_blank");
}
Symbol 365 Button
on (release) {
getURL ("http://www.hopeku.com/", "_blank");
}
Instance of Symbol 229 MovieClip "vcam" in Symbol 366 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = (_y + ((_root.screen_._y - _y) / 1));
_x = (_x + ((_root.screen_._x - _x) / 1));
this.score = 0;
}
Symbol 366 MovieClip Frame 1105
_root.play();