Frame 1
var _cm = new ContextMenu();
_cm.hideBuiltInItems();
this.menu = _cm;
stop();
Frame 2
Frame 3
this.main = new com.gameInABottle.games.treasureOfCutlassReef.Main(this);
Frame 4
stop();
Symbol 11 MovieClip Frame 1
this.onEnterFrame = function () {
if (loaded) {
_root.gotoAndPlay(2);
} else {
timeProgressPercent = ((getTimer() - startTime) / 5000) * 100;
percent = Math.min(timeProgressPercent, Math.min(100, Math.max(Math.floor(((_root.getBytesLoaded() - 10000) / (_root.getBytesTotal() - 10000)) * 100), 0)));
loaderbar._width = percent * 5;
if (percent == 100) {
this.afterLoadStep++;
if (this.afterLoadStep > 60) {
this._alpha = this._alpha - 5;
}
if (this._alpha < 1) {
this.loaded = true;
}
}
}
};
this.startTime = getTimer();
this.loaded = false;
this.afterLoadStep = 0;
stop();
Instance of Symbol 10 MovieClip in Symbol 11 MovieClip Frame 1
on (release) {
getURL ("http://www.arcadebliss.com/", "_blank");
}
Symbol 562 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.Main] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.Main
{
var isIntroOver, mcRoot, mcwRoot, btnOptions, mcOptions, optStep, isOptionsDragging, isPaused, preferences, vfxEngine, staticData, player, zCurrSoundMc, ctrlUpgrades, ctrlLoadSave, ctrlIngame, ctrlTutorial, ctrlModeSelector, ctrlMainMenu, ctrlCredits, ctrlMap, ctrlHighScores, ctrlEndGame, ctrlStartup, nextScreen, currentScreen, sounds, sndAmbient, sndBlast1, sndBlast2, sndBlast3, sndBlastBig, sndCannon1, sndCannon2, sndCannon3, sndCannon4, sndCannon5, sndCannon6, sndCannon7, sndCannon8, sndCannon9, sndCannon10, sndCannon11, sndCannon12, sndCloseCombat, sndTickOver, sndTickPress, sndPlunder, sndUpgrade, sndIngameDoorOpen, sndIngameDoorClose, sndIngameDoorCloseEnd;
function Main (pMcRoot) {
var vThis = this;
isIntroOver = false;
var _local3 = _root.createEmptyMovieClip("mainLoop", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.MAIN_LOOP);
_local3.onEnterFrame = function () {
vThis.doEnterFrame();
};
mcRoot = pMcRoot;
mcwRoot = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwRoot(mcRoot);
btnOptions = mcRoot.attachMovie("btnOptions", "btnOptions", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.BTN_OPTIONS);
btnOptions._y = -480;
mcOptions = mcRoot.attachMovie("mcOptions", "mcOptions", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.MC_OPTIONS);
mcOptions._visible = false;
mcOptions._y = -480;
optStep = 10;
isOptionsDragging = false;
isPaused = false;
initiateOptionsPanel();
preferences = new com.gameInABottle.games.treasureOfCutlassReef.entity.Preferences();
vfxEngine = new com.gameInABottle.games.treasureOfCutlassReef.util.VfxEngine(preferences);
staticData = new com.gameInABottle.games.treasureOfCutlassReef.constants.StaticData(this);
player = new com.gameInABottle.games.treasureOfCutlassReef.entity.Player();
zCurrSoundMc = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.SOUNDS_MIN;
initiateSoundObjects();
ctrlUpgrades = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlUpgrades(mcwRoot.mcwUpgrades, this);
ctrlLoadSave = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlLoadSave(mcwRoot.mcwLoadSave, this);
ctrlIngame = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlIngame(mcwRoot.mcwIngame, this);
ctrlTutorial = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlTutorial(mcwRoot.mcwTutorial, this);
ctrlModeSelector = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlModeSelector(mcwRoot.mcwModeSelector, this);
ctrlMainMenu = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlMainMenu(mcwRoot.mcwMainMenu, this);
ctrlCredits = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlCredits(mcwRoot.mcwCredits, this);
ctrlMap = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlMap(mcwRoot.mcwMap, this);
ctrlHighScores = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlHighScores(mcwRoot.mcwHighScores, this);
ctrlEndGame = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlEndGame(mcwRoot.mcwEndGame, this);
ctrlStartup = new com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlStartup(mcwRoot.mcwStartup, this);
nextScreen = SCR_STARTUP;
switchScreenVisibility();
renderOptions();
setAllSoundsVolume();
}
function doEnterFrame() {
if (isPaused) {
if (isOptionsDragging) {
renderOptions();
}
} else {
var _local3 = (640 - _root._xmouse) + _root._ymouse;
if (_local3 > 110) {
optStep = Math.min(10, optStep + 1);
}
if (_local3 < 80) {
optStep = Math.max(0, optStep - 1);
}
if (isIntroOver) {
btnOptions._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeInOut(10 - optStep, 585, -72, 10);
btnOptions._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeInOut(10 - optStep, -37, 20, 10);
btnOptions.mcTf._xscale = (btnOptions.mcTf._yscale = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeInOut(10 - optStep, 40, 60, 10));
btnOptions.mcTf._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeInOut(10 - optStep, 8, 9, 10);
}
if (currentScreen == SCR_MAINMENU) {
ctrlMainMenu.doEnterFrame();
} else if (currentScreen == SCR_MODESELECTOR) {
ctrlModeSelector.doEnterFrame();
} else if (currentScreen == SCR_CREDITS) {
ctrlCredits.doEnterFrame();
} else if (currentScreen == SCR_MAP) {
ctrlMap.doEnterFrame();
} else if (currentScreen == SCR_TUTORIAL) {
ctrlTutorial.doEnterFrame();
} else if (currentScreen == SCR_INGAME) {
ctrlIngame.doEnterFrame();
} else if (currentScreen == SCR_UPGRADES) {
ctrlUpgrades.doEnterFrame();
} else if (currentScreen == SCR_HIGHSCORES) {
ctrlHighScores.doEnterFrame();
} else if ((currentScreen == SCR_LOADSAVE_LOAD) || (currentScreen == SCR_LOADSAVE_SAVE)) {
ctrlLoadSave.doEnterFrame();
} else if (currentScreen == SCR_ENDGAME) {
ctrlEndGame.doEnterFrame();
} else if (currentScreen == SCR_STARTUP) {
ctrlStartup.doEnterFrame();
}
}
}
function switchScreenVisibility() {
vfxEngine.removeAllVfx();
Key.removeListener(ctrlIngame.keyListener);
ctrlIngame.mcTexts.removeMovieClip();
ctrlIngame.pnlOutcome.removeMovieClip();
ctrlIngame.pnlLevelInfo.removeMovieClip();
currentScreen = nextScreen;
mcwRoot.mcEndGame._visible = false;
mcwRoot.mcMainMenu._visible = false;
mcwRoot.mcMap._visible = false;
mcwRoot.mcTutorial._visible = false;
mcwRoot.mcUpgrades._visible = false;
mcwRoot.mcIngame._visible = false;
mcwRoot.mcCredits._visible = false;
mcwRoot.mcModeSelector._visible = false;
mcwRoot.mcLoadSave._visible = false;
mcwRoot.mcHighScores._visible = false;
mcwRoot.mcStartup._visible = false;
mcwRoot.mcIngameDoor._visible = false;
if (currentScreen == SCR_ENDGAME) {
ctrlEndGame.initiate();
} else if (currentScreen == SCR_MAINMENU) {
ctrlMainMenu.initiate();
} else if (currentScreen == SCR_MAP) {
ctrlMap.initiate();
} else if (currentScreen == SCR_TUTORIAL) {
ctrlTutorial.initiate();
} else if (currentScreen == SCR_UPGRADES) {
ctrlUpgrades.initiate();
} else if (currentScreen == SCR_INGAME) {
ctrlIngame.initiate();
} else if (currentScreen == SCR_CREDITS) {
ctrlCredits.initiate();
} else if (currentScreen == SCR_MODESELECTOR) {
ctrlModeSelector.initiate();
} else if ((currentScreen == SCR_LOADSAVE_LOAD) || (currentScreen == SCR_LOADSAVE_SAVE)) {
ctrlLoadSave.initiate();
} else if (currentScreen == SCR_HIGHSCORES) {
ctrlHighScores.initiate();
} else if (currentScreen == SCR_STARTUP) {
ctrlStartup.initiate();
}
}
function initiateSoundObjects() {
sounds = new Array();
sndAmbient = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndAmbient", zCurrSoundMc++));
pushSound(sndAmbient, "ambient.wav");
sndBlast1 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndBlast1", zCurrSoundMc++));
pushSound(sndBlast1, "blast1.wav");
sndBlast2 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndBlast2", zCurrSoundMc++));
pushSound(sndBlast2, "blast2.wav");
sndBlast3 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndBlast3", zCurrSoundMc++));
pushSound(sndBlast3, "blast3.wav");
sndBlastBig = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndBlastBig", zCurrSoundMc++));
pushSound(sndBlastBig, "blastBig.wav");
sndCannon1 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon1", zCurrSoundMc++));
pushSound(sndCannon1, "cannon1.wav");
sndCannon2 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon2", zCurrSoundMc++));
pushSound(sndCannon2, "cannon2.wav");
sndCannon3 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon3", zCurrSoundMc++));
pushSound(sndCannon3, "cannon3.wav");
sndCannon4 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon4", zCurrSoundMc++));
pushSound(sndCannon4, "cannon4.wav");
sndCannon5 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon5", zCurrSoundMc++));
pushSound(sndCannon5, "cannon5.wav");
sndCannon6 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon6", zCurrSoundMc++));
pushSound(sndCannon6, "cannon6.wav");
sndCannon7 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon7", zCurrSoundMc++));
pushSound(sndCannon7, "cannon7.wav");
sndCannon8 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon8", zCurrSoundMc++));
pushSound(sndCannon8, "cannon8.wav");
sndCannon9 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon9", zCurrSoundMc++));
pushSound(sndCannon9, "cannon9.wav");
sndCannon10 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon10", zCurrSoundMc++));
pushSound(sndCannon10, "cannon10.wav");
sndCannon11 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon11", zCurrSoundMc++));
pushSound(sndCannon11, "cannon11.wav");
sndCannon12 = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCannon12", zCurrSoundMc++));
pushSound(sndCannon12, "cannon12.wav");
sndCloseCombat = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndCloseCombat", zCurrSoundMc++));
pushSound(sndCloseCombat, "closecombat.wav");
sndTickOver = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndTickOver", zCurrSoundMc++));
pushSound(sndTickOver, "tickOver.wav");
sndTickPress = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndTickPress", zCurrSoundMc++));
pushSound(sndTickPress, "tickPress.wav");
sndPlunder = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndPlunder", zCurrSoundMc++));
pushSound(sndPlunder, "plunder.wav");
sndUpgrade = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndUpgrade", zCurrSoundMc++));
pushSound(sndUpgrade, "upgrade.wav");
sndIngameDoorOpen = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndIngameDoorOpen", zCurrSoundMc++));
pushSound(sndIngameDoorOpen, "ingameDoorOpen.wav");
sndIngameDoorClose = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndIngameDoorClose", zCurrSoundMc++));
pushSound(sndIngameDoorClose, "ingameDoorClose.wav");
sndIngameDoorCloseEnd = new Sound(mcwRoot.mc.createEmptyMovieClip("mc_sndIngameDoorCloseEnd", zCurrSoundMc++));
pushSound(sndIngameDoorCloseEnd, "ingameDoorCloseEnd.wav");
}
function pushSound(pSnd, pId) {
pSnd.attachSound(pId);
Object(pSnd).id = pId;
sounds.push(pSnd);
}
function setAllSoundsVolume() {
if (!isPaused) {
var _local2 = 0;
while (_local2 < sounds.length) {
Sound(sounds[_local2]).setVolume(preferences.soundVolume);
_local2++;
}
} else {
var _local2 = 0;
while (_local2 < sounds.length) {
Sound(sounds[_local2]).setVolume(0);
_local2++;
}
}
}
function switchOptions() {
if (isPaused) {
if (!isOptionsDragging) {
preferences.flush();
isPaused = false;
mcOptions._visible = false;
mcOptions._y = -500;
btnOptions._x = 630;
btnOptions._y = -52;
}
} else {
if (currentScreen == SCR_INGAME) {
mcOptions.mcTfPaused.gotoAndStop(1);
mcOptions.btnContinue._visible = true;
mcOptions.btnReturn._visible = true;
mcOptions.btnDone._visible = false;
} else {
mcOptions.mcTfPaused.gotoAndStop(2);
mcOptions.btnContinue._visible = false;
mcOptions.btnReturn._visible = false;
mcOptions.btnDone._visible = true;
}
isPaused = true;
renderOptions();
mcOptions._visible = true;
mcOptions._y = 0;
}
setAllSoundsVolume();
}
function initiateOptionsPanel() {
var vThis = this;
btnOptions.onPress = function () {
vThis.sndTickPress.start();
vThis.switchOptions();
};
mcOptions.btnDone.onPress = function () {
vThis.switchOptions();
vThis.sndTickPress.start();
};
mcOptions.btnContinue.onPress = function () {
vThis.switchOptions();
vThis.sndTickPress.start();
};
mcOptions.btnReturn.onPress = function () {
vThis.ctrlIngame.returnToMainMenu();
vThis.switchOptions();
vThis.sndTickPress.start();
};
mcOptions.btnQuality.onPress = function () {
MovieClip(this).startDrag(false, 94, MovieClip(this)._y, 544, MovieClip(this)._y);
vThis.isOptionsDragging = true;
};
mcOptions.btnQuality.onRelease = function () {
MovieClip(this).stopDrag();
vThis.isOptionsDragging = false;
};
mcOptions.btnQuality.onReleaseOutside = function () {
MovieClip(this).stopDrag();
vThis.isOptionsDragging = false;
};
mcOptions.btnVfxNum.onPress = function () {
MovieClip(this).startDrag(false, 94, MovieClip(this)._y, 544, MovieClip(this)._y);
vThis.isOptionsDragging = true;
};
mcOptions.btnVfxNum.onRelease = function () {
MovieClip(this).stopDrag();
vThis.isOptionsDragging = false;
};
mcOptions.btnVfxNum.onReleaseOutside = function () {
MovieClip(this).stopDrag();
vThis.isOptionsDragging = false;
};
mcOptions.btnVfxNumPerType.onPress = function () {
MovieClip(this).startDrag(false, 94, MovieClip(this)._y, 544, MovieClip(this)._y);
vThis.isOptionsDragging = true;
};
mcOptions.btnVfxNumPerType.onRelease = function () {
MovieClip(this).stopDrag();
vThis.isOptionsDragging = false;
};
mcOptions.btnVfxNumPerType.onReleaseOutside = function () {
MovieClip(this).stopDrag();
vThis.isOptionsDragging = false;
};
mcOptions.btnSoundVolume.onPress = function () {
MovieClip(this).startDrag(false, 94, MovieClip(this)._y, 544, MovieClip(this)._y);
vThis.isOptionsDragging = true;
};
mcOptions.btnSoundVolume.onRelease = function () {
MovieClip(this).stopDrag();
vThis.isOptionsDragging = false;
};
mcOptions.btnSoundVolume.onReleaseOutside = function () {
MovieClip(this).stopDrag();
vThis.isOptionsDragging = false;
};
renderOptions();
}
function renderOptions() {
if (isOptionsDragging) {
preferences.soundVolumeBase = com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox.convertCoord(94, 544, mcOptions.btnSoundVolume._x, 0, 100);
preferences.qualityBase = com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox.convertCoord(94, 544, mcOptions.btnQuality._x, 0, 100);
preferences.vfxNumBase = com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox.convertCoord(94, 544, mcOptions.btnVfxNum._x, 0, 100);
preferences.vfxNumPerTypeBase = com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox.convertCoord(94, 544, mcOptions.btnVfxNumPerType._x, 0, 100);
} else {
mcOptions.btnSoundVolume._x = com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox.convertCoord(0, 100, preferences.soundVolumeBase, 94, 544);
mcOptions.btnQuality._x = com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox.convertCoord(0, 100, preferences.qualityBase, 94, 544);
mcOptions.btnVfxNum._x = com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox.convertCoord(0, 100, preferences.vfxNumBase, 94, 544);
mcOptions.btnVfxNumPerType._x = com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox.convertCoord(0, 100, preferences.vfxNumPerTypeBase, 94, 544);
}
preferences.soundVolume = Math.round(preferences.soundVolumeBase);
preferences.quality = ((preferences.qualityBase < 33) ? 0 : (((preferences.qualityBase < 66) ? 1 : (((preferences.qualityBase < 95) ? 2 : 3)))));
preferences.vfxNum = ((preferences.vfxNumBase > 99) ? 100000 : (Math.round(preferences.vfxNumBase)));
preferences.vfxNumPerType = ((preferences.vfxNumPerTypeBase > 99) ? 100000 : (Math.round(preferences.vfxNumPerTypeBase)));
mcOptions.tfSoundVolume.text = preferences.soundVolume.toString();
mcOptions.tfQuality.text = ((preferences.quality == 0) ? "low" : (((preferences.quality == 1) ? "medium" : (((preferences.quality == 2) ? "high" : "high+clouds")))));
_root._quality = ((preferences.quality == 0) ? "LOW" : (((preferences.quality == 1) ? "MEDIUM" : "HIGH")));
mcOptions.tfVfxNum.text = ((preferences.vfxNum == 100000) ? "unlimited" : (preferences.vfxNum.toString()));
mcOptions.tfVfxNumPerType.text = ((preferences.vfxNumPerType == 100000) ? "unlimited" : (preferences.vfxNumPerType.toString()));
}
var SCR_STARTUP = "SCR_STARTUP";
var SCR_MAINMENU = "SCR_MAINMENU";
var SCR_ENDGAME = "SCR_ENDGAME";
var SCR_MAP = "SCR_MAP";
var SCR_INGAME = "SCR_INGAME";
var SCR_UPGRADES = "SCR_UPGRADES";
var SCR_TUTORIAL = "SCR_TUTORIAL";
var SCR_CREDITS = "SCR_CREDITS";
var SCR_MODESELECTOR = "SCR_MODESELECTOR";
var SCR_LOADSAVE_LOAD = "SCR_LOADSAVE_LOAD";
var SCR_LOADSAVE_SAVE = "SCR_LOADSAVE_SAVE";
var SCR_HIGHSCORES = "SCR_HIGHSCORES";
var URL_HIGHSCORELIST = "http://www.arcadebliss.com/featured_games/treasure_of_cutlass_reef_highscores.php";
var URL_MOREGAMES = "http://www.arcadebliss.com/";
}
Symbol 563 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwRoot] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwRoot
{
var mc, mcwMainMenu, mcMainMenu, mcwEndGame, mcEndGame, mcwMap, mcMap, mcwTutorial, mcTutorial, mcwUpgrades, mcUpgrades, mcwCredits, mcCredits, mcwIngame, mcIngame, mcwModeSelector, mcModeSelector, mcwHighScores, mcHighScores, mcwLoadSave, mcLoadSave, mcwStartup, mcStartup, mcIngameDoor;
function McwRoot (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
mcwMainMenu = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwMainMenu(mcMainMenu);
mcwEndGame = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwEndGame(mcEndGame);
mcwMap = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwMap(mcMap);
mcwTutorial = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwTutorial(mcTutorial);
mcwUpgrades = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwUpgrades(mcUpgrades);
mcwCredits = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwCredits(mcCredits);
mcwIngame = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwIngame(mcIngame);
mcwModeSelector = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwModeSelector(mcModeSelector);
mcwHighScores = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwHighScores(mcHighScores);
mcwLoadSave = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwLoadSave(mcLoadSave);
mcwStartup = new com.gameInABottle.games.treasureOfCutlassReef.mcw.McwStartup(mcStartup);
mcIngameDoor = mc.attachMovie("ingameDoor", "ingameDoor", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.INGAME_DOOR);
mcIngameDoor._visible = false;
mcIngameDoor._x = 320;
mcIngameDoor._y = 240;
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 564 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwMainMenu] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwMainMenu
{
var mc;
function McwMainMenu (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 565 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwEndGame] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwEndGame
{
var mc, tfName;
function McwEndGame (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
tfName.restrict = "A-Z a-z";
tfName.maxChars = 16;
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 566 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwMap] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwMap
{
var mc;
function McwMap (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 567 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwTutorial] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwTutorial
{
var mc;
function McwTutorial (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 568 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwUpgrades] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwUpgrades
{
var mc;
function McwUpgrades (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 569 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwCredits] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwCredits
{
var mc;
function McwCredits (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 570 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwIngame] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwIngame
{
var mc;
function McwIngame (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 571 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwModeSelector] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwModeSelector
{
var mc;
function McwModeSelector (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 572 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwHighScores] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwHighScores
{
var mc;
function McwHighScores (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 573 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwLoadSave] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwLoadSave
{
var mc;
function McwLoadSave (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 574 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.mcw.McwStartup] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.mcw.McwStartup
{
var mc;
function McwStartup (pSource) {
mc = pSource;
for (var _local3 in pSource) {
this[_local3] = pSource[_local3];
}
for (var _local3 in this) {
if (((this[_local3] instanceof MovieClip) || (this[_local3] instanceof TextField)) || (this[_local3] instanceof Button)) {
this[_local3].useHandCursor = false;
this[_local3].tabEnabled = false;
this[_local3].tabChildren = false;
}
if (MovieClip(this[_local3])._name.indexOf("btn") == 0) {
this[_local3].useHandCursor = true;
}
}
adjustDepths();
}
function adjustDepths() {
}
}
Symbol 575 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.constants.Z] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.constants.Z
{
function Z () {
}
static var CHEATPANEL_INGAME = 999301;
static var CHEATPANEL_LOADSAVE = 999300;
static var MC_OPTIONS = 999200;
static var BTN_OPTIONS = 999100;
static var INGAME_DOOR = 999000;
static var LEVELOUTCOMEPANEL = 510000;
static var LEVELINFOPANEL = 500000;
static var SEA_TEXTS = 400000;
static var INFOPANEL_MIN = 360000;
static var VFX_HIGH_MIN = 350000;
static var VFX_MIN = 300000;
static var CANNONBALL_MIN = 200000;
static var ENEMYSHIP_MIN = 102000;
static var PIRATESHIP = 100000;
static var VFX_DEEP_MIN = 50000;
static var BATTLEWHEEL_MIN = 40000;
static var MAPSHIP_MIN = 500;
static var SOUNDS_MIN = 10;
static var MAIN_LOOP = 1;
}
Symbol 576 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.util.VfxEngine] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.util.VfxEngine
{
var z, zDeep, zHigh, blasts, blackSmokes, whiteSmokes, debris, splashes, infoPanelBlasts, clouds, totalVfxNum, preferences;
function VfxEngine (pPrefs) {
z = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_MIN;
zDeep = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_DEEP_MIN;
zHigh = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_HIGH_MIN;
blasts = new Array();
blackSmokes = new Array();
whiteSmokes = new Array();
debris = new Array();
splashes = new Array();
infoPanelBlasts = new Array();
clouds = new Array();
totalVfxNum = 0;
preferences = pPrefs;
}
function doEnterFrame() {
var _local2 = 0;
while (_local2 < blackSmokes.length) {
blackSmokes[_local2]._alpha = blackSmokes[_local2]._alpha - ((Math.random() * 3) + 1.5);
blackSmokes[_local2]._xscale = blackSmokes[_local2]._xscale + 3;
blackSmokes[_local2]._yscale = blackSmokes[_local2]._yscale + 3;
if (blackSmokes[_local2]._alpha < 1) {
blackSmokes[_local2].removeMovieClip();
blackSmokes.splice(_local2, 1);
_local2--;
totalVfxNum--;
}
_local2++;
}
_local2 = 0;
while (_local2 < blasts.length) {
blasts[_local2]._alpha = blasts[_local2]._alpha - 10;
if (blasts[_local2]._alpha < 1) {
blasts[_local2].removeMovieClip();
blasts.splice(_local2, 1);
_local2--;
totalVfxNum--;
}
_local2++;
}
_local2 = 0;
while (_local2 < whiteSmokes.length) {
whiteSmokes[_local2]._alpha = whiteSmokes[_local2]._alpha - 5;
if (whiteSmokes[_local2]._alpha < 1) {
whiteSmokes[_local2].removeMovieClip();
whiteSmokes.splice(_local2, 1);
_local2--;
totalVfxNum--;
}
_local2++;
}
_local2 = 0;
while (_local2 < debris.length) {
debris[_local2]._alpha = debris[_local2]._alpha - 0.14;
debris[_local2].energy--;
if (debris[_local2].energy > 0) {
debris[_local2]._x = debris[_local2]._x + debris[_local2].speedX;
debris[_local2]._y = debris[_local2]._y + debris[_local2].speedY;
debris[_local2]._rotation = debris[_local2]._rotation + debris[_local2].spin;
} else if (debris[_local2].isSplashed != true) {
debris[_local2].isSplashed = true;
createSplash(debris[_local2]._x, debris[_local2]._y);
}
if (debris[_local2]._alpha < 1) {
debris[_local2].removeMovieClip();
debris.splice(_local2, 1);
_local2--;
totalVfxNum--;
}
_local2++;
}
_local2 = 0;
while (_local2 < splashes.length) {
splashes[_local2]._alpha = splashes[_local2]._alpha - 5;
splashes[_local2]._xscale = splashes[_local2]._xscale + 10;
splashes[_local2]._yscale = splashes[_local2]._yscale + 10;
if (splashes[_local2]._alpha < 1) {
splashes[_local2].removeMovieClip();
splashes.splice(_local2, 1);
_local2--;
totalVfxNum--;
}
_local2++;
}
_local2 = 0;
while (_local2 < infoPanelBlasts.length) {
infoPanelBlasts[_local2]._alpha = infoPanelBlasts[_local2]._alpha - 5;
infoPanelBlasts[_local2]._xscale = infoPanelBlasts[_local2]._xscale + 5;
infoPanelBlasts[_local2]._yscale = infoPanelBlasts[_local2]._yscale + 5;
if (infoPanelBlasts[_local2]._alpha < 1) {
infoPanelBlasts[_local2].removeMovieClip();
infoPanelBlasts.splice(_local2, 1);
_local2--;
}
_local2++;
}
_local2 = 0;
while (_local2 < clouds.length) {
clouds[_local2]._y = clouds[_local2]._y + clouds[_local2].speed;
if (clouds[_local2]._y > 700) {
clouds[_local2].removeMovieClip();
clouds.splice(_local2, 1);
_local2--;
totalVfxNum--;
}
_local2++;
}
}
function createBlast(pX, pY) {
if ((preferences.vfxNum > 0) && (preferences.vfxNumPerType > 0)) {
if ((totalVfxNum < (preferences.vfxNum * 0.5)) || (Math.round() > (totalVfxNum / preferences.vfxNum))) {
if ((blackSmokes.length < (preferences.vfxNumPerType * 0.5)) || (Math.round() > (blackSmokes.length / preferences.vfxNumPerType))) {
var _local7 = _root.attachMovie("mcVfxSmokeBlack", "vfx" + z, z++);
_local7._rotation = Math.random() * 360;
_local7._x = pX;
_local7._y = pY;
blackSmokes.push(_local7);
totalVfxNum++;
}
if ((blasts.length < (preferences.vfxNumPerType * 0.5)) || (Math.round() > (blasts.length / preferences.vfxNumPerType))) {
var _local8 = _root.attachMovie("mcBlast", "vfx" + z, z++);
_local8._rotation = Math.random() * 360;
_local8._x = pX;
_local8._y = pY;
blasts.push(_local8);
totalVfxNum++;
if (z > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_MIN + 10000)) {
z = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_MIN;
}
}
if ((debris.length < (preferences.vfxNumPerType * 0.5)) || (Math.round() > (debris.length / preferences.vfxNumPerType))) {
var _local4 = 0;
while (_local4 < 2) {
var _local3 = _root.attachMovie("mcDebris", "vfxDeep" + zDeep, zDeep++);
_local3._rotation = Math.random() * 360;
_local3._x = pX;
_local3._y = pY;
_local3.speedX = (Math.random() * 6) - 3;
_local3.speedY = (Math.random() * 6) - 3;
_local3.energy = Math.floor(Math.random() * 20) + 20;
_local3.spin = (Math.random() * 60) - 30;
if (Math.random() > 0.5) {
_local3.gotoAndStop(2);
}
debris.push(_local3);
totalVfxNum++;
_local4++;
}
if (zDeep > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_DEEP_MIN + 10000)) {
zDeep = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_DEEP_MIN;
}
}
}
}
}
function createWhiteSmoke(pX, pY) {
if ((preferences.vfxNum > 0) && (preferences.vfxNumPerType > 0)) {
if ((totalVfxNum < (preferences.vfxNum * 0.6)) || (Math.round() > (totalVfxNum / preferences.vfxNum))) {
if ((whiteSmokes.length < (preferences.vfxNumPerType * 0.6)) || (Math.round() > (whiteSmokes.length / preferences.vfxNumPerType))) {
if (Math.random() > 0.33) {
var _local3 = _root.attachMovie("mcVfxSmokeWhite", "vfx" + zDeep, zDeep++);
_local3._rotation = Math.random() * 360;
_local3._x = (pX + (Math.random() * 3)) - 1.5;
_local3._y = (pY + (Math.random() * 3)) - 1.5;
_local3._xscale = 125;
_local3._yscale = 125;
} else {
var _local3 = _root.attachMovie("mcVfxSmokeWhite", "vfx" + z, z++);
_local3._rotation = Math.random() * 360;
_local3._x = (pX + (Math.random() * 3)) - 1.5;
_local3._y = (pY + (Math.random() * 3)) - 1.5;
_local3._xscale = 125;
_local3._yscale = 125;
_local3._alpha = 65;
}
whiteSmokes.push(_local3);
if (zDeep > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_DEEP_MIN + 10000)) {
zDeep = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_DEEP_MIN;
}
if (z > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_MIN + 10000)) {
z = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_MIN;
}
}
}
}
}
function createSplash(pX, pY) {
if ((preferences.vfxNum > 0) && (preferences.vfxNumPerType > 0)) {
if ((totalVfxNum < (preferences.vfxNum * 0.6)) || (Math.round() > (totalVfxNum / preferences.vfxNum))) {
if ((splashes.length < (preferences.vfxNumPerType * 0.6)) || (Math.round() > (splashes.length / preferences.vfxNumPerType))) {
var _local3 = _root.attachMovie("mcSplash", "vfx" + zDeep, zDeep++);
_local3._x = pX;
_local3._y = pY;
_local3._xscale = 10;
_local3._yscale = 10;
_local3._alpha = 70;
splashes.push(_local3);
if (zDeep > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_DEEP_MIN + 10000)) {
zDeep = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_DEEP_MIN;
}
totalVfxNum++;
}
}
}
}
function createCloud() {
if ((preferences.vfxNum > 0) && (preferences.vfxNumPerType > 0)) {
if ((totalVfxNum < (preferences.vfxNum * 0.6)) || (Math.round() > (totalVfxNum / preferences.vfxNum))) {
if ((clouds.length < (preferences.vfxNumPerType * 0.6)) || (Math.round() > (clouds.length / preferences.vfxNumPerType))) {
var _local3 = _root.attachMovie("cloud", "vfx" + zHigh, zHigh++);
if (Math.random() > 0.5) {
_local3._x = Math.random() * 100;
} else {
_local3._x = 540 + (Math.random() * 100);
}
_local3._y = -300;
var _local5 = (Math.random() * 80) + 80;
_local3.gotoAndStop(Math.floor(Math.random() * 4.99) + 1);
_local3._xscale = _local5;
_local3._yscale = _local5;
_local3._alpha = (Math.random() * 50) + 50;
_local3.speed = (Math.random() * 2) + 3.5;
_local3._rotation = Math.random() * 360;
var _local4 = new Array();
_local4.push(new flash.filters.DropShadowFilter(220, 45, 0, 250, 5, 5, 1, 1, false, false));
_local3.filters = _local4;
clouds.push(_local3);
if (zHigh > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_HIGH_MIN + 10000)) {
zHigh = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_HIGH_MIN;
}
totalVfxNum++;
}
}
}
}
function createInfoPanelBlast(pX, pY) {
var _local3 = _root.attachMovie("vfxInfoPanelBlast", "vfx" + z, z++);
_local3._x = pX + 21;
_local3._y = pY + 8.5;
infoPanelBlasts.push(_local3);
if (z > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_MIN + 10000)) {
z = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.VFX_MIN;
}
}
function removeAllVfx() {
var _local2 = 0;
while (_local2 < blasts.length) {
MovieClip(blasts[_local2]).removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < blackSmokes.length) {
MovieClip(blackSmokes[_local2]).removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < whiteSmokes.length) {
MovieClip(whiteSmokes[_local2]).removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < debris.length) {
MovieClip(debris[_local2]).removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < splashes.length) {
MovieClip(splashes[_local2]).removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < infoPanelBlasts.length) {
MovieClip(infoPanelBlasts[_local2]).removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < clouds.length) {
MovieClip(clouds[_local2]).removeMovieClip();
_local2++;
}
blasts = new Array();
blackSmokes = new Array();
whiteSmokes = new Array();
debris = new Array();
splashes = new Array();
infoPanelBlasts = new Array();
clouds = new Array();
}
}
Symbol 577 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.entity.Preferences] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.entity.Preferences
{
var so, soundVolumeBase, qualityBase, vfxNumBase, vfxNumPerTypeBase;
function Preferences () {
so = SharedObject.getLocal("preferences");
soundVolumeBase = ((so.data.soundVolumeBase == undefined) ? 70 : (so.data.soundVolumeBase));
qualityBase = ((so.data.qualityBase == undefined) ? 100 : (so.data.qualityBase));
vfxNumBase = ((so.data.vfxNumBase == undefined) ? 100 : (so.data.vfxNumBase));
vfxNumPerTypeBase = ((so.data.vfxNumPerTypeBase == undefined) ? 100 : (so.data.vfxNumPerTypeBase));
flush();
}
function flush() {
so.data.soundVolumeBase = soundVolumeBase;
so.data.qualityBase = qualityBase;
so.data.vfxNumBase = vfxNumBase;
so.data.vfxNumPerTypeBase = vfxNumPerTypeBase;
so.flush();
}
}
Symbol 578 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.entity.Player] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.entity.Player
{
var currentLevel, difficulty, levGunNum, levFirepower, levReloadSpeed, levCrew, levArmor, levShipMoveSpeed, levShipTurnSpeed, checksum, scoreKey, score, goldKey, gold;
function Player () {
setScore(0);
setGold(0);
currentLevel = 0;
difficulty = 0;
levGunNum = 0;
levFirepower = 0;
levReloadSpeed = 0;
levCrew = 0;
levArmor = 0;
levShipMoveSpeed = 0;
levShipTurnSpeed = 0;
}
function populateFromObject(pObj) {
setScore(pObj.score);
setGold(pObj.gold);
currentLevel = pObj.currentLevel;
difficulty = pObj.difficulty;
levGunNum = pObj.levGunNum;
levFirepower = pObj.levFirepower;
levReloadSpeed = pObj.levReloadSpeed;
levCrew = pObj.levCrew;
levArmor = pObj.levArmor;
levShipMoveSpeed = pObj.levShipMoveSpeed;
levShipTurnSpeed = pObj.levShipTurnSpeed;
checksum = pObj.checksum;
}
function createCloneObject() {
var _local2 = new Object();
_local2.score = getScore();
_local2.gold = getGold();
_local2.currentLevel = currentLevel;
_local2.difficulty = difficulty;
_local2.levGunNum = levGunNum;
_local2.levFirepower = levFirepower;
_local2.levReloadSpeed = levReloadSpeed;
_local2.levCrew = levCrew;
_local2.levArmor = levArmor;
_local2.levShipMoveSpeed = levShipMoveSpeed;
_local2.levShipTurnSpeed = levShipTurnSpeed;
_local2.checksum = checksum;
return(_local2);
}
function calculateSaveChecksum() {
var _local2 = 17382644 /* 0x1093CF4 */;
var _local4 = getScore().toString();
var _local3 = 0;
while (_local3 < _local4.length) {
_local2 = ((_local2 * _local4.charCodeAt(_local3)) % 91123214) + 901;
_local3++;
}
var _local5 = getGold().toString();
_local3 = 0;
while (_local3 < _local5.length) {
_local2 = ((_local2 * _local5.charCodeAt(_local3)) % 91133215) + 332;
_local3++;
}
var _local7 = currentLevel.toString();
_local3 = 0;
while (_local3 < _local7.length) {
_local2 = ((_local2 * _local7.charCodeAt(_local3)) % 93817482) + 222;
_local3++;
}
var _local6 = difficulty.toString();
_local3 = 0;
while (_local3 < _local6.length) {
_local2 = ((_local2 * _local6.charCodeAt(_local3)) % 91817482) + 122;
_local3++;
}
if (levArmor == undefined) {
return(_local2);
}
_local2 = ((_local2 * (levArmor + 123)) % 92817482) + 120000;
_local2 = ((_local2 * (levCrew + 124)) % 92817472) + 121000;
_local2 = ((_local2 * (levFirepower + 125)) % 92817462) + 122000;
_local2 = ((_local2 * (levGunNum + 126)) % 92817452) + 123000;
_local2 = ((_local2 * (levReloadSpeed + 127)) % 92817442) + 124000;
_local2 = ((_local2 * (levShipMoveSpeed + 128)) % 92817432) + 125000;
_local2 = ((_local2 * (levShipTurnSpeed + 129)) % 92817422) + 126000;
return(_local2);
}
function setScore(pScore) {
scoreKey = Math.floor(Math.random() * 1000000) - 500000;
score = pScore + scoreKey;
}
function getScore() {
return(score - scoreKey);
}
function setGold(pGold) {
goldKey = Math.floor(Math.random() * 1000000) - 500000;
gold = pGold + goldKey;
}
function getGold() {
return(gold - goldKey);
}
function calculateHighScoreChecksum(pName, pScore, pLevel, pDifficulty) {
var _local1 = 37382647 /* 0x23A69F7 */;
var _local2 = 0;
while (_local2 < pName.length) {
_local1 = ((_local1 * pName.charCodeAt(_local2)) % 93837482) + 222;
_local2++;
}
var _local3 = pScore.toString();
_local2 = 0;
while (_local2 < _local3.length) {
_local1 = ((_local1 * _local3.charCodeAt(_local2)) % 92133214) + 921;
_local2++;
}
_local1 = (_local1 * (pLevel + 513)) % 92135554;
_local1 = (_local1 * (pDifficulty + 408)) % 91835357;
return(_local1);
}
}
Symbol 579 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.constants.StaticData] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.constants.StaticData
{
var main, levels;
function StaticData (pMain) {
main = pMain;
levels = new Array();
var _local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 495;
_local2.mapY = 294;
_local2.isShipFacingRight = true;
_local2.mapPirRelX = 45;
_local2.mapPirRelY = 0;
_local2.flagShipName = "Black Widow";
var _local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 200;
_local3.isWeakened = true;
_local3.goldCarried = 1400;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 300;
_local3.isWeakened = true;
_local3.goldCarried = 1400;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 120;
_local3.xMax = 520;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 4000;
_local3.isWeakened = true;
_local3.goldCarried = 1200;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 120;
_local3.xMax = 520;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 4200;
_local3.isWeakened = true;
_local3.goldCarried = 900;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 120;
_local3.xMax = 520;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 4300;
_local3.isWeakened = true;
_local3.goldCarried = 900;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 1;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 8000;
_local3.isWeakened = true;
_local3.sailType = _local3.ST_BOSS;
_local3.goldCarried = 2400;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 452;
_local2.mapY = 349;
_local2.isShipFacingRight = true;
_local2.mapPirRelX = 45;
_local2.mapPirRelY = 0;
_local2.flagShipName = "Bloodlust";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 300;
_local3.deltaY = 0.15;
_local3.spawnTime = 200;
_local3.goldCarried = 1500;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 340;
_local3.deltaY = 0.15;
_local3.spawnTime = 400;
_local3.isWeakened = true;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 350;
_local3.deltaY = 0.3;
_local3.spawnTime = 2000;
_local3.goldCarried = 1600;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 2;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 150;
_local3.deltaY = 0.05;
_local3.spawnTime = 4000;
_local3.goldCarried = 1400;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.isWeakened = true;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 540;
_local3.deltaY = 0.35;
_local3.spawnTime = 4000;
_local3.goldCarried = 1500;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 1;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 4800;
_local3.isWeakened = true;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 1;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 5400;
_local3.isWeakened = true;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 1;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 6000;
_local3.isWeakened = true;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 1;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 1;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 1;
_local3.sailType = _local3.ST_BOSS;
_local3.xMin = 100;
_local3.xMax = 520;
_local3.x = 350;
_local3.deltaY = 0.3;
_local3.spawnTime = 15000;
_local3.goldCarried = 3000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 397;
_local2.mapY = 393;
_local2.isShipFacingRight = true;
_local2.mapPirRelX = 45;
_local2.mapPirRelY = 0;
_local2.flagShipName = "Warlock";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 200;
_local3.goldCarried = 2000;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 400;
_local3.deltaY = 0.1;
_local3.spawnTime = 1900;
_local3.goldCarried = 2000;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 1;
_local3.isWeakened = true;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 300;
_local3.deltaY = 0.1;
_local3.spawnTime = 2000;
_local3.goldCarried = 2000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 1;
_local3.isWeakened = true;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 550;
_local3.deltaY = 0.2;
_local3.spawnTime = 2000;
_local3.goldCarried = 2000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 300;
_local3.deltaY = 0.1;
_local3.spawnTime = 4000;
_local3.goldCarried = 1500;
_local3.sailType = _local3.ST_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 1;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 500;
_local3.deltaY = 0.1;
_local3.spawnTime = 4050;
_local3.goldCarried = 2000;
_local3.sailType = _local3.ST_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 320;
_local3.deltaY = 0.25;
_local3.spawnTime = 7000;
_local3.goldCarried = 1000;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 2;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 1;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 450;
_local3.deltaY = 0.05;
_local3.spawnTime = 7000;
_local3.goldCarried = 1100;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 3;
_local3.cannonsNumLevel = 3;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 3;
_local3.reloadSpeedLevel = 3;
_local3.sailType = _local3.ST_BOSS;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 12000;
_local3.goldCarried = 6000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 278;
_local2.mapY = 397;
_local2.isShipFacingRight = true;
_local2.mapPirRelX = 28;
_local2.mapPirRelY = 29;
_local2.flagShipName = "Mystery";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 2;
_local3.firePowerLevel = 1;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 200;
_local3.goldCarried = 2200;
_local3.sailType = _local3.ST_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 1500;
_local3.goldCarried = 1900;
_local3.sailType = _local3.ST_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 250;
_local3.deltaY = 0.2;
_local3.spawnTime = 3050;
_local3.goldCarried = 1900;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 450;
_local3.deltaY = 0.15;
_local3.spawnTime = 3000;
_local3.goldCarried = 2000;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 150;
_local3.deltaY = 0.1;
_local3.spawnTime = 6000;
_local3.goldCarried = 2100;
_local3.sailType = _local3.ST_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 470;
_local3.deltaY = 0.1;
_local3.spawnTime = 6000;
_local3.goldCarried = 1750;
_local3.sailType = _local3.ST_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 180;
_local3.deltaY = 0.1;
_local3.spawnTime = 8200;
_local3.goldCarried = 5150;
_local3.sailType = _local3.ST_DOWNRED_BLANK;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 11000;
_local3.goldCarried = 2200;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.isWeakened = true;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.35;
_local3.spawnTime = 14000;
_local3.goldCarried = 600;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.isWeakened = true;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.35;
_local3.spawnTime = 14200;
_local3.goldCarried = 600;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.isWeakened = true;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.35;
_local3.spawnTime = 14400;
_local3.goldCarried = 600;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.isWeakened = true;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.35;
_local3.spawnTime = 14600;
_local3.goldCarried = 600;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.isWeakened = true;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.35;
_local3.spawnTime = 14800;
_local3.goldCarried = 600;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 3;
_local3.crewNumLevel = 4;
_local3.firePowerLevel = 3;
_local3.cannonsNumLevel = 3;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 3;
_local3.reloadSpeedLevel = 3;
_local3.sailType = _local3.ST_BOSS;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 15000;
_local3.goldCarried = 5000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 134;
_local2.mapY = 400;
_local2.isShipFacingRight = true;
_local2.mapPirRelX = 28;
_local2.mapPirRelY = 29;
_local2.flagShipName = "Greedy Rapier";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 200;
_local3.goldCarried = 1800;
_local3.sailType = _local3.ST_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 1;
_local3.crewNumLevel = 2;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 200;
_local3.deltaY = 0.12;
_local3.spawnTime = 2000;
_local3.goldCarried = 1900;
_local3.sailType = _local3.ST_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 1;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 520;
_local3.deltaY = 0.1;
_local3.spawnTime = 2000;
_local3.goldCarried = 1800;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 1;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 300;
_local3.deltaY = 0.1;
_local3.spawnTime = 3600;
_local3.goldCarried = 2500;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 500;
_local3.deltaY = 0.05;
_local3.spawnTime = 3600;
_local3.goldCarried = 2000;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 6000;
_local3.goldCarried = 3300;
_local3.sailType = _local3.ST_DOT4;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 2;
_local3.crewNumLevel = 2;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.4;
_local3.spawnTime = 6300;
_local3.goldCarried = 1800;
_local3.sailType = _local3.ST_DOT4;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 2;
_local3.crewNumLevel = 2;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.4;
_local3.spawnTime = 6500;
_local3.goldCarried = 1800;
_local3.sailType = _local3.ST_DOT4;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 2;
_local3.crewNumLevel = 2;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.4;
_local3.spawnTime = 6700;
_local3.goldCarried = 1800;
_local3.sailType = _local3.ST_DOT4;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 2;
_local3.firePowerLevel = 1;
_local3.cannonsNumLevel = 3;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 550;
_local3.deltaY = 0.08;
_local3.spawnTime = 7500;
_local3.goldCarried = 3900;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 2;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 3;
_local3.cannonsNumLevel = 1;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 200;
_local3.deltaY = 0.3;
_local3.spawnTime = 9400;
_local3.goldCarried = 1900;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 0;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 560;
_local3.deltaY = 0.25;
_local3.spawnTime = 9450;
_local3.goldCarried = 2000;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 4;
_local3.crewNumLevel = 4;
_local3.firePowerLevel = 4;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 4;
_local3.turnSpeedMaxLevel = 4;
_local3.reloadSpeedLevel = 4;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 11000;
_local3.sailType = _local3.ST_BOSS;
_local3.goldCarried = 8000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 80;
_local2.mapY = 310;
_local2.isShipFacingRight = true;
_local2.mapPirRelX = 28;
_local2.mapPirRelY = 29;
_local2.flagShipName = "Cursed Blessing";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 2;
_local3.crewNumLevel = 4;
_local3.firePowerLevel = 4;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 200;
_local3.goldCarried = 5500;
_local3.sailType = _local3.ST_DOT5;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 2;
_local3.crewNumLevel = 4;
_local3.firePowerLevel = 4;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 1000;
_local3.goldCarried = 5500;
_local3.sailType = _local3.ST_DOT5;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 2;
_local3.crewNumLevel = 4;
_local3.firePowerLevel = 4;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 2000;
_local3.goldCarried = 5500;
_local3.sailType = _local3.ST_DOT5;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 2;
_local3.crewNumLevel = 4;
_local3.firePowerLevel = 4;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 3000;
_local3.goldCarried = 5500;
_local3.sailType = _local3.ST_DOT5;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 5;
_local3.crewNumLevel = 5;
_local3.firePowerLevel = 5;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 4;
_local3.turnSpeedMaxLevel = 5;
_local3.reloadSpeedLevel = 5;
_local3.sailType = _local3.ST_PIRATEHUNTER1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.35;
_local3.spawnTime = 4300;
_local3.goldCarried = 1000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 5;
_local3.crewNumLevel = 5;
_local3.firePowerLevel = 5;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 4;
_local3.turnSpeedMaxLevel = 5;
_local3.reloadSpeedLevel = 5;
_local3.sailType = _local3.ST_PIRATEHUNTER2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.32;
_local3.spawnTime = 4400;
_local3.goldCarried = 1000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 6;
_local3.crewNumLevel = 6;
_local3.firePowerLevel = 6;
_local3.cannonsNumLevel = 6;
_local3.speedMaxLevel = 6;
_local3.turnSpeedMaxLevel = 6;
_local3.reloadSpeedLevel = 6;
_local3.sailType = _local3.ST_BOSS;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0;
_local3.spawnTime = 4500;
_local3.goldCarried = 6000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 94;
_local2.mapY = 239;
_local2.isShipFacingRight = false;
_local2.mapPirRelX = -28;
_local2.mapPirRelY = 29;
_local2.flagShipName = "Poison Rain";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 3;
_local3.cannonsNumLevel = 3;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 3;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 50;
_local3.goldCarried = 4000;
_local3.sailType = _local3.ST_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 4;
_local3.crewNumLevel = 9;
_local3.firePowerLevel = 7;
_local3.cannonsNumLevel = 7;
_local3.speedMaxLevel = 6;
_local3.turnSpeedMaxLevel = 6;
_local3.reloadSpeedLevel = 7;
_local3.sailType = _local3.ST_PIRATEHUNTER2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 150;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 3;
_local3.cannonsNumLevel = 3;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 3;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 250;
_local3.goldCarried = 4000;
_local3.sailType = _local3.ST_DOT5;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 3;
_local3.cannonsNumLevel = 3;
_local3.speedMaxLevel = 3;
_local3.turnSpeedMaxLevel = 3;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 450;
_local3.goldCarried = 4000;
_local3.sailType = _local3.ST_DOT5;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 4;
_local3.crewNumLevel = 4;
_local3.firePowerLevel = 4;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 4;
_local3.turnSpeedMaxLevel = 4;
_local3.reloadSpeedLevel = 4;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 1350;
_local3.goldCarried = 4000;
_local3.sailType = _local3.ST_DOT4;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 4;
_local3.crewNumLevel = 4;
_local3.firePowerLevel = 4;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 4;
_local3.turnSpeedMaxLevel = 4;
_local3.reloadSpeedLevel = 4;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 1650;
_local3.goldCarried = 4000;
_local3.sailType = _local3.ST_DOT5;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 4;
_local3.armorLevel = 7;
_local3.crewNumLevel = 7;
_local3.firePowerLevel = 7;
_local3.cannonsNumLevel = 7;
_local3.speedMaxLevel = 7;
_local3.turnSpeedMaxLevel = 7;
_local3.reloadSpeedLevel = 7;
_local3.sailType = _local3.ST_BOSS;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 320;
_local3.deltaY = 0.2;
_local3.spawnTime = 6200;
_local3.goldCarried = 8000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 107;
_local2.mapY = 164;
_local2.isShipFacingRight = false;
_local2.mapPirRelX = -45;
_local2.mapPirRelY = 0;
_local2.flagShipName = "Vengeance";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 100;
_local3.goldCarried = 3000;
_local3.sailType = _local3.ST_DOWNRED_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 150;
_local3.goldCarried = 3000;
_local3.sailType = _local3.ST_DOWNRED_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 200;
_local3.goldCarried = 3000;
_local3.sailType = _local3.ST_DOWNRED_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 1100;
_local3.goldCarried = 4000;
_local3.sailType = _local3.ST_DOWNRED_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 1200;
_local3.goldCarried = 4000;
_local3.sailType = _local3.ST_DOWNRED_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 1;
_local3.armorLevel = 0;
_local3.crewNumLevel = 0;
_local3.firePowerLevel = 0;
_local3.cannonsNumLevel = 4;
_local3.speedMaxLevel = 0;
_local3.turnSpeedMaxLevel = 0;
_local3.reloadSpeedLevel = 0;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 1250;
_local3.goldCarried = 3000;
_local3.sailType = _local3.ST_DOT5;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 1;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 1;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.1;
_local3.spawnTime = 2000;
_local3.goldCarried = 3000;
_local3.sailType = _local3.ST_DOWNRED_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 1;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 1;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.4;
_local3.spawnTime = 2100;
_local3.goldCarried = 3000;
_local3.sailType = _local3.ST_DOWNRED_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 1;
_local3.crewNumLevel = 1;
_local3.firePowerLevel = 1;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 1;
_local3.turnSpeedMaxLevel = 1;
_local3.reloadSpeedLevel = 1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.27;
_local3.spawnTime = 2200;
_local3.goldCarried = 3000;
_local3.sailType = _local3.ST_DOWNRED_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 8;
_local3.crewNumLevel = 9;
_local3.firePowerLevel = 7;
_local3.cannonsNumLevel = 7;
_local3.speedMaxLevel = 7;
_local3.turnSpeedMaxLevel = 7;
_local3.reloadSpeedLevel = 7;
_local3.sailType = _local3.ST_PIRATEHUNTER3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.2;
_local3.spawnTime = 5200;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 8;
_local3.crewNumLevel = 9;
_local3.firePowerLevel = 7;
_local3.cannonsNumLevel = 7;
_local3.speedMaxLevel = 7;
_local3.turnSpeedMaxLevel = 7;
_local3.reloadSpeedLevel = 7;
_local3.sailType = _local3.ST_PIRATEHUNTER1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.3;
_local3.spawnTime = 5400;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 4;
_local3.armorLevel = 5;
_local3.crewNumLevel = 5;
_local3.firePowerLevel = 5;
_local3.cannonsNumLevel = 10;
_local3.speedMaxLevel = 5;
_local3.turnSpeedMaxLevel = 5;
_local3.reloadSpeedLevel = 5;
_local3.sailType = _local3.ST_BOSS;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 320;
_local3.deltaY = 0.2;
_local3.spawnTime = 10000;
_local3.goldCarried = 9000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 183;
_local2.mapY = 88;
_local2.isShipFacingRight = false;
_local2.mapPirRelX = -45;
_local2.mapPirRelY = 0;
_local2.flagShipName = "Pandora";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 100;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_DOWNRED_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 400;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_DOWNRED_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 700;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_DOWNRED_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 1000;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_DOWNRED_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 1300;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_UPRED_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 1600;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_UPRED_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 1900;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_DOWNRED_DOT1;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 2200;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_UPRED_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 2500;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_UPRED_DOT3;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 3;
_local3.crewNumLevel = 3;
_local3.firePowerLevel = 2;
_local3.cannonsNumLevel = 2;
_local3.speedMaxLevel = 2;
_local3.turnSpeedMaxLevel = 2;
_local3.reloadSpeedLevel = 3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 2800;
_local3.goldCarried = 4500;
_local3.sailType = _local3.ST_DOWNRED_DOT2;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 4;
_local3.armorLevel = 5;
_local3.crewNumLevel = 5;
_local3.firePowerLevel = 5;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 5;
_local3.turnSpeedMaxLevel = 5;
_local3.reloadSpeedLevel = 5;
_local3.sailType = _local3.ST_BOSS;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 320;
_local3.deltaY = 0.2;
_local3.spawnTime = 10000;
_local3.goldCarried = 10000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
_local2.mapX = 287;
_local2.mapY = 79;
_local2.isShipFacingRight = false;
_local2.mapPirRelX = -45;
_local2.mapPirRelY = 0;
_local2.flagShipName = "Lost Sister";
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 6;
_local3.crewNumLevel = 6;
_local3.firePowerLevel = 6;
_local3.cannonsNumLevel = 6;
_local3.speedMaxLevel = 6;
_local3.turnSpeedMaxLevel = 6;
_local3.reloadSpeedLevel = 6;
_local3.sailType = _local3.ST_PIRATEHUNTER4;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 120;
_local3.deltaY = 0.1;
_local3.spawnTime = 100;
_local3.goldCarried = 5000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 8;
_local3.crewNumLevel = 9;
_local3.firePowerLevel = 7;
_local3.cannonsNumLevel = 7;
_local3.speedMaxLevel = 7;
_local3.turnSpeedMaxLevel = 7;
_local3.reloadSpeedLevel = 7;
_local3.sailType = _local3.ST_PIRATEHUNTER2;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.23;
_local3.spawnTime = 500;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 6;
_local3.crewNumLevel = 6;
_local3.firePowerLevel = 6;
_local3.cannonsNumLevel = 6;
_local3.speedMaxLevel = 6;
_local3.turnSpeedMaxLevel = 6;
_local3.reloadSpeedLevel = 6;
_local3.sailType = _local3.ST_PIRATEHUNTER1;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 270;
_local3.deltaY = 0.1;
_local3.spawnTime = 100;
_local3.goldCarried = 5000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 6;
_local3.crewNumLevel = 6;
_local3.firePowerLevel = 6;
_local3.cannonsNumLevel = 6;
_local3.speedMaxLevel = 6;
_local3.turnSpeedMaxLevel = 6;
_local3.reloadSpeedLevel = 6;
_local3.sailType = _local3.ST_PIRATEHUNTER3;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 420;
_local3.deltaY = 0.1;
_local3.spawnTime = 100;
_local3.goldCarried = 5000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 5;
_local3.crewNumLevel = 5;
_local3.firePowerLevel = 5;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 5;
_local3.turnSpeedMaxLevel = 5;
_local3.reloadSpeedLevel = 5;
_local3.sailType = _local3.ST_DOT5;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 570;
_local3.deltaY = 0.1;
_local3.spawnTime = 100;
_local3.goldCarried = 5000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 5;
_local3.crewNumLevel = 5;
_local3.firePowerLevel = 5;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 5;
_local3.turnSpeedMaxLevel = 5;
_local3.reloadSpeedLevel = 5;
_local3.sailType = _local3.ST_DOT5;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 200;
_local3.deltaY = 0.1;
_local3.spawnTime = 3000;
_local3.goldCarried = 6000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 5;
_local3.crewNumLevel = 5;
_local3.firePowerLevel = 5;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 5;
_local3.turnSpeedMaxLevel = 5;
_local3.reloadSpeedLevel = 5;
_local3.sailType = _local3.ST_DOT5;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 350;
_local3.deltaY = 0.1;
_local3.spawnTime = 3100;
_local3.goldCarried = 6000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 3;
_local3.armorLevel = 5;
_local3.crewNumLevel = 5;
_local3.firePowerLevel = 5;
_local3.cannonsNumLevel = 5;
_local3.speedMaxLevel = 5;
_local3.turnSpeedMaxLevel = 5;
_local3.reloadSpeedLevel = 5;
_local3.sailType = _local3.ST_DOT5;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 500;
_local3.deltaY = 0.4;
_local3.spawnTime = 3200;
_local3.goldCarried = 6000;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 8;
_local3.crewNumLevel = 9;
_local3.firePowerLevel = 7;
_local3.cannonsNumLevel = 7;
_local3.speedMaxLevel = 7;
_local3.turnSpeedMaxLevel = 7;
_local3.reloadSpeedLevel = 7;
_local3.sailType = _local3.ST_PIRATEHUNTER4;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 0;
_local3.deltaY = 0.25;
_local3.spawnTime = 9700;
_local3.goldCarried = 800;
_local2.shipDatas.push(_local3);
_local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 4;
_local3.armorLevel = 9;
_local3.crewNumLevel = 9;
_local3.firePowerLevel = 9;
_local3.cannonsNumLevel = 9;
_local3.speedMaxLevel = 6;
_local3.turnSpeedMaxLevel = 6;
_local3.reloadSpeedLevel = 9;
_local3.sailType = _local3.ST_BOSS;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = 320;
_local3.deltaY = 0.2;
_local3.spawnTime = 10000;
_local3.goldCarried = 10000;
_local2.shipDatas.push(_local3);
levels.push(_local2);
var _local4 = new com.gameInABottle.games.treasureOfCutlassReef.constants.StaticDataExt1();
levels.push(_local4.levels[0]);
levels.push(_local4.levels[1]);
}
}
Symbol 580 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData
{
var shipDatas;
function LevelData () {
shipDatas = new Array();
}
}
Symbol 581 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData
{
function ShipData () {
}
var ST_BLANK = "ST_BLANK";
var ST_DOT1 = "ST_DOT1";
var ST_DOT2 = "ST_DOT2";
var ST_DOT3 = "ST_DOT3";
var ST_DOT4 = "ST_DOT4";
var ST_DOT5 = "ST_DOT5";
var ST_DOT6 = "ST_DOT6";
var ST_UPRED_BLANK = "ST_UPRED_BLANK";
var ST_UPRED_DOT1 = "ST_UPRED_DOT1";
var ST_UPRED_DOT2 = "ST_UPRED_DOT2";
var ST_UPRED_DOT3 = "ST_UPRED_DOT3";
var ST_DOWNRED_BLANK = "ST_DOWNRED_BLANK";
var ST_DOWNRED_DOT1 = "ST_DOWNRED_DOT1";
var ST_DOWNRED_DOT2 = "ST_DOWNRED_DOT2";
var ST_DOWNRED_DOT3 = "ST_DOWNRED_DOT3";
var ST_PIRATEHUNTER1 = "ST_PIRATEHUNTER1";
var ST_PIRATEHUNTER2 = "ST_PIRATEHUNTER2";
var ST_PIRATEHUNTER3 = "ST_PIRATEHUNTER3";
var ST_PIRATEHUNTER4 = "ST_PIRATEHUNTER4";
var ST_BOSS = "ST_BOSS";
var ST_FINAL_MINION = "ST_FINAL_MINION";
}
Symbol 582 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.constants.StaticDataExt1] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.constants.StaticDataExt1
{
var levels;
function StaticDataExt1 () {
levels = new Array();
vLevelData = new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData();
vLevelData.mapX = 309;
vLevelData.mapY = 162;
vLevelData.isShipFacingRight = true;
vLevelData.mapPirRelX = 38;
vLevelData.mapPirRelY = -27;
vLevelData.flagShipName = "Windwalker";
var _local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 7;
_local2.crewNumLevel = 7;
_local2.firePowerLevel = 7;
_local2.cannonsNumLevel = 7;
_local2.speedMaxLevel = 7;
_local2.turnSpeedMaxLevel = 7;
_local2.reloadSpeedLevel = 7;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.2;
_local2.spawnTime = 100;
_local2.goldCarried = 4000;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 9;
_local2.crewNumLevel = 9;
_local2.firePowerLevel = 9;
_local2.cannonsNumLevel = 9;
_local2.speedMaxLevel = 9;
_local2.turnSpeedMaxLevel = 9;
_local2.reloadSpeedLevel = 9;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.2;
_local2.spawnTime = 1500;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.goldCarried = 4000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 3;
_local2.armorLevel = 11;
_local2.crewNumLevel = 11;
_local2.firePowerLevel = 11;
_local2.cannonsNumLevel = 11;
_local2.speedMaxLevel = 11;
_local2.turnSpeedMaxLevel = 11;
_local2.reloadSpeedLevel = 11;
_local2.sailType = _local2.ST_PIRATEHUNTER4;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.3;
_local2.spawnTime = 1700;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 3;
_local2.armorLevel = 11;
_local2.crewNumLevel = 11;
_local2.firePowerLevel = 11;
_local2.cannonsNumLevel = 11;
_local2.speedMaxLevel = 11;
_local2.turnSpeedMaxLevel = 11;
_local2.reloadSpeedLevel = 11;
_local2.sailType = _local2.ST_PIRATEHUNTER2;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.3;
_local2.spawnTime = 1900;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 9;
_local2.crewNumLevel = 9;
_local2.firePowerLevel = 9;
_local2.cannonsNumLevel = 9;
_local2.speedMaxLevel = 9;
_local2.turnSpeedMaxLevel = 9;
_local2.reloadSpeedLevel = 9;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.2;
_local2.spawnTime = 3000;
_local2.goldCarried = 4000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 9;
_local2.crewNumLevel = 9;
_local2.firePowerLevel = 9;
_local2.cannonsNumLevel = 9;
_local2.speedMaxLevel = 9;
_local2.turnSpeedMaxLevel = 9;
_local2.reloadSpeedLevel = 9;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.2;
_local2.spawnTime = 4500;
_local2.goldCarried = 4000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 3;
_local2.armorLevel = 5;
_local2.crewNumLevel = 11;
_local2.firePowerLevel = 11;
_local2.cannonsNumLevel = 11;
_local2.speedMaxLevel = 11;
_local2.turnSpeedMaxLevel = 11;
_local2.reloadSpeedLevel = 11;
_local2.sailType = _local2.ST_PIRATEHUNTER1;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.3;
_local2.spawnTime = 4600;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 7;
_local2.crewNumLevel = 7;
_local2.firePowerLevel = 7;
_local2.cannonsNumLevel = 7;
_local2.speedMaxLevel = 7;
_local2.turnSpeedMaxLevel = 7;
_local2.reloadSpeedLevel = 7;
_local2.sailType = _local2.ST_DOWNRED_DOT2;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.2;
_local2.spawnTime = 6000;
_local2.goldCarried = 4000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 7;
_local2.crewNumLevel = 7;
_local2.firePowerLevel = 7;
_local2.cannonsNumLevel = 7;
_local2.speedMaxLevel = 7;
_local2.turnSpeedMaxLevel = 7;
_local2.reloadSpeedLevel = 7;
_local2.sailType = _local2.ST_DOWNRED_DOT2;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.2;
_local2.spawnTime = 7500;
_local2.goldCarried = 4000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 7;
_local2.crewNumLevel = 7;
_local2.firePowerLevel = 7;
_local2.cannonsNumLevel = 7;
_local2.speedMaxLevel = 7;
_local2.turnSpeedMaxLevel = 7;
_local2.reloadSpeedLevel = 7;
_local2.sailType = _local2.ST_DOWNRED_DOT2;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.2;
_local2.spawnTime = 8200;
_local2.goldCarried = 4000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 4;
_local2.armorLevel = 11;
_local2.crewNumLevel = 11;
_local2.firePowerLevel = 11;
_local2.cannonsNumLevel = 11;
_local2.speedMaxLevel = 6;
_local2.turnSpeedMaxLevel = 6;
_local2.reloadSpeedLevel = 11;
_local2.sailType = _local2.ST_BOSS;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 320;
_local2.deltaY = 0.2;
_local2.spawnTime = 20000;
_local2.goldCarried = 10000;
vLevelData.shipDatas.push(_local2);
levels.push(vLevelData);
var vLevelData = (new com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData());
vLevelData.mapX = 302;
vLevelData.mapY = 235;
vLevelData.isShipFacingRight = false;
vLevelData.mapPirRelX = -5;
vLevelData.mapPirRelY = -32;
vLevelData.flagShipName = "Fallen Angel";
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 1;
_local2.armorLevel = 5;
_local2.crewNumLevel = 5;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 5;
_local2.speedMaxLevel = 5;
_local2.turnSpeedMaxLevel = 5;
_local2.reloadSpeedLevel = 5;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -800;
_local2.deltaY = 0.1;
_local2.spawnTime = 10;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 1;
_local2.armorLevel = 5;
_local2.crewNumLevel = 5;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 5;
_local2.speedMaxLevel = 5;
_local2.turnSpeedMaxLevel = 5;
_local2.reloadSpeedLevel = 5;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -650;
_local2.deltaY = 0.1;
_local2.spawnTime = 10;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 1;
_local2.armorLevel = 5;
_local2.crewNumLevel = 5;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 5;
_local2.speedMaxLevel = 5;
_local2.turnSpeedMaxLevel = 5;
_local2.reloadSpeedLevel = 5;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -500;
_local2.deltaY = 0.1;
_local2.spawnTime = 10;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 1;
_local2.armorLevel = 5;
_local2.crewNumLevel = 5;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 5;
_local2.speedMaxLevel = 5;
_local2.turnSpeedMaxLevel = 5;
_local2.reloadSpeedLevel = 5;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -350;
_local2.deltaY = 0.1;
_local2.spawnTime = 10;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 1;
_local2.armorLevel = 5;
_local2.crewNumLevel = 5;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 5;
_local2.speedMaxLevel = 5;
_local2.turnSpeedMaxLevel = 5;
_local2.reloadSpeedLevel = 5;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -200;
_local2.deltaY = 0.1;
_local2.spawnTime = 10;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 1;
_local2.armorLevel = 5;
_local2.crewNumLevel = 5;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 5;
_local2.speedMaxLevel = 5;
_local2.turnSpeedMaxLevel = 5;
_local2.reloadSpeedLevel = 5;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 950;
_local2.deltaY = 0.1;
_local2.spawnTime = 2500;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 1;
_local2.armorLevel = 5;
_local2.crewNumLevel = 5;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 5;
_local2.speedMaxLevel = 5;
_local2.turnSpeedMaxLevel = 5;
_local2.reloadSpeedLevel = 5;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 800;
_local2.deltaY = 0.1;
_local2.spawnTime = 2500;
_local2.goldCarried = 800;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 6;
_local2.crewNumLevel = 6;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 6;
_local2.speedMaxLevel = 6;
_local2.turnSpeedMaxLevel = 6;
_local2.reloadSpeedLevel = 6;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -1000;
_local2.deltaY = 0.15;
_local2.spawnTime = 5500;
_local2.goldCarried = 1000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 6;
_local2.crewNumLevel = 6;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 6;
_local2.speedMaxLevel = 6;
_local2.turnSpeedMaxLevel = 6;
_local2.reloadSpeedLevel = 6;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -700;
_local2.deltaY = 0.2;
_local2.spawnTime = 5500;
_local2.goldCarried = 1000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 2;
_local2.armorLevel = 6;
_local2.crewNumLevel = 6;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 6;
_local2.speedMaxLevel = 6;
_local2.turnSpeedMaxLevel = 6;
_local2.reloadSpeedLevel = 6;
_local2.sailType = _local2.ST_DOWNRED_DOT3;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -400;
_local2.deltaY = 0.25;
_local2.spawnTime = 5500;
_local2.goldCarried = 1000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 4;
_local2.armorLevel = 12;
_local2.crewNumLevel = 12;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 12;
_local2.speedMaxLevel = 12;
_local2.turnSpeedMaxLevel = 12;
_local2.reloadSpeedLevel = 12;
_local2.sailType = _local2.ST_PIRATEHUNTER1;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.3;
_local2.spawnTime = 10000;
_local2.goldCarried = 1000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 4;
_local2.armorLevel = 12;
_local2.crewNumLevel = 12;
_local2.firePowerLevel = 12;
_local2.cannonsNumLevel = 12;
_local2.speedMaxLevel = 12;
_local2.turnSpeedMaxLevel = 12;
_local2.reloadSpeedLevel = 12;
_local2.sailType = _local2.ST_PIRATEHUNTER1;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = 0;
_local2.deltaY = 0.3;
_local2.spawnTime = 11000;
_local2.goldCarried = 1000;
vLevelData.shipDatas.push(_local2);
_local2 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local2.hullType = 5;
_local2.armorLevel = 15;
_local2.crewNumLevel = 15;
_local2.firePowerLevel = 15;
_local2.cannonsNumLevel = 15;
_local2.speedMaxLevel = 11;
_local2.turnSpeedMaxLevel = 7;
_local2.reloadSpeedLevel = 15;
_local2.sailType = _local2.ST_BOSS;
_local2.xMin = 80;
_local2.xMax = 560;
_local2.x = -300;
_local2.deltaY = -100;
_local2.spawnTime = 16000;
_local2.goldCarried = 36000;
vLevelData.shipDatas.push(_local2);
levels.push(vLevelData);
}
}
Symbol 583 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlUpgrades] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlUpgrades
{
var mcw, main, prcsArmor, prcsCannon, prcsCrew, prcsFirepower, prcsMoveSpeed, prcsReloadSpeed, prcsTurnSpeed, screenStatus, screenStep, levArmorInitial, levCrewInitial, levFirepowerInitial, levCannonInitial, levReloadSpeedInitial, levMoveSpeedInitial, levTurnSpeedInitial, isChangeMade, btnUndoStep, goldInitialKey, goldInitial;
function CtrlUpgrades (pMcw, pMain) {
mcw = pMcw;
main = pMain;
prcsArmor = new Array(1000, 1300, 1600, 2000, 2600, 4000, 6000, 8000, 10000, 12000);
prcsCannon = new Array(1000, 1500, 2200, 3200, 4500, 6000, 8000, 10000, 12000, 14000);
prcsCrew = new Array(1200, 1800, 2400, 3600, 5000, 7000, 9000, 12000, 14000, 16000);
prcsFirepower = new Array(1000, 1400, 2000, 2800, 3800, 5000, 7000, 9000, 11000, 13000);
prcsMoveSpeed = new Array(1400, 2000, 2800, 4400, 6400, 8000, 10000, 12500, 15000, 17500);
prcsReloadSpeed = new Array(1400, 2000, 2800, 4400, 6400, 8000, 10000, 12500, 15000, 17500);
prcsTurnSpeed = new Array(1600, 2400, 3200, 4800, 7200, 9600, 12000, 14000, 16000, 18000);
buttonsInit();
}
function buttonsInit() {
var vThis = this;
mcw.btnArmor.onPress = function () {
vThis.isChangeMade = true;
vThis.upgradeArmor();
};
mcw.btnCannon.onPress = function () {
vThis.isChangeMade = true;
vThis.upgradeCannon();
};
mcw.btnCrew.onPress = function () {
vThis.isChangeMade = true;
vThis.upgradeCrew();
};
mcw.btnFirepower.onPress = function () {
vThis.isChangeMade = true;
vThis.upgradeFirepower();
};
mcw.btnMoveSpeed.onPress = function () {
vThis.isChangeMade = true;
vThis.upgradeMoveSpeed();
};
mcw.btnReloadSpeed.onPress = function () {
vThis.isChangeMade = true;
vThis.upgradeReloadSpeed();
};
mcw.btnTurnSpeed.onPress = function () {
vThis.isChangeMade = true;
vThis.upgradeTurnSpeed();
};
mcw.btnUndo.onPress = function () {
vThis.undoChanges();
};
mcw.btnArmor.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnCannon.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnCrew.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnFirepower.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnMoveSpeed.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnReloadSpeed.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnTurnSpeed.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnUndo.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnSave.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_LOADSAVE_SAVE;
vThis.main.sndTickPress.start();
}
};
mcw.btnSave.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnSave.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_LOADSAVE_SAVE;
vThis.main.sndTickPress.start();
}
};
mcw.btnSave.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnDone.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_MAP;
vThis.main.sndTickPress.start();
}
};
mcw.btnDone.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
}
function initiate() {
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.mc._visible = true;
mcw.mc._y = -480;
mcw.btnDone._y = -600;
mcw.btnSave._y = -600;
mcw.mcGold._y = -600;
levArmorInitial = main.player.levArmor;
levCrewInitial = main.player.levCrew;
levFirepowerInitial = main.player.levFirepower;
levCannonInitial = main.player.levGunNum;
levReloadSpeedInitial = main.player.levReloadSpeed;
levMoveSpeedInitial = main.player.levShipMoveSpeed;
levTurnSpeedInitial = main.player.levShipTurnSpeed;
setGoldInitial(main.player.getGold());
isChangeMade = false;
renderUpgrades();
btnUndoStep = 0;
mcw.btnUndo._x = -50;
}
function renderUpgrades() {
mcw.mcLevelArmor.gotoAndStop(main.player.levArmor + 1);
mcw.mcLevelCrew.gotoAndStop(main.player.levCrew + 1);
mcw.mcLevelFirepower.gotoAndStop(main.player.levFirepower + 1);
mcw.mcLevelCannon.gotoAndStop(main.player.levGunNum + 1);
mcw.mcLevelReloadSpeed.gotoAndStop(main.player.levReloadSpeed + 1);
mcw.mcLevelMoveSpeed.gotoAndStop(main.player.levShipMoveSpeed + 1);
mcw.mcLevelTurnSpeed.gotoAndStop(main.player.levShipTurnSpeed + 1);
mcw.mcGold.tf.text = main.player.getGold() + " gold";
if (main.player.levArmor > (6 + main.player.difficulty)) {
mcw.tfArmor.text = "Maximum upgrade\nlevel reached";
mcw.tfArmor.textColor = 8674878 /* 0x845E3E */;
mcw.btnArmor._visible = false;
} else if (main.player.getGold() < prcsArmor[main.player.levArmor + 1]) {
mcw.tfArmor.text = ("Not enough gold\n(" + prcsArmor[main.player.levArmor + 1]) + " needed)";
mcw.tfArmor.textColor = 11149344 /* 0xAA2020 */;
mcw.btnArmor._visible = false;
} else {
mcw.tfArmor.text = ("Upgrade ship armor:\n" + prcsArmor[main.player.levArmor + 1]) + " gold";
mcw.tfArmor.textColor = 0;
mcw.btnArmor._visible = true;
}
if (main.player.levCrew > (6 + main.player.difficulty)) {
mcw.tfCrew.text = "Maximum upgrade\nlevel reached";
mcw.tfCrew.textColor = 8674878 /* 0x845E3E */;
mcw.btnCrew._visible = false;
} else if (main.player.getGold() < prcsCrew[main.player.levCrew + 1]) {
mcw.tfCrew.text = ("Not enough gold\n(" + prcsCrew[main.player.levCrew + 1]) + " needed)";
mcw.tfCrew.textColor = 11149344 /* 0xAA2020 */;
mcw.btnCrew._visible = false;
} else {
mcw.tfCrew.text = ("More crew on board:\n" + prcsCrew[main.player.levCrew + 1]) + " gold";
mcw.tfCrew.textColor = 0;
mcw.btnCrew._visible = true;
}
if (main.player.levFirepower > (6 + main.player.difficulty)) {
mcw.tfFirepower.text = "Maximum upgrade\nlevel reached";
mcw.tfFirepower.textColor = 8674878 /* 0x845E3E */;
mcw.btnFirepower._visible = false;
} else if (main.player.getGold() < prcsFirepower[main.player.levFirepower + 1]) {
mcw.tfFirepower.text = ("Not enough gold\n(" + prcsFirepower[main.player.levFirepower + 1]) + " needed)";
mcw.tfFirepower.textColor = 11149344 /* 0xAA2020 */;
mcw.btnFirepower._visible = false;
} else {
mcw.tfFirepower.text = ("More damage per hit:\n" + prcsFirepower[main.player.levFirepower + 1]) + " gold";
mcw.tfFirepower.textColor = 0;
mcw.btnFirepower._visible = true;
}
if (main.player.levGunNum > (6 + main.player.difficulty)) {
mcw.tfCannon.text = "Maximum upgrade\nlevel reached";
mcw.tfCannon.textColor = 8674878 /* 0x845E3E */;
mcw.btnCannon._visible = false;
} else if (main.player.getGold() < prcsCannon[main.player.levGunNum + 1]) {
mcw.tfCannon.text = ("Not enough gold\n(" + prcsCannon[main.player.levGunNum + 1]) + " needed)";
mcw.tfCannon.textColor = 11149344 /* 0xAA2020 */;
mcw.btnCannon._visible = false;
} else {
mcw.tfCannon.text = ("More cannons:\n" + prcsCannon[main.player.levGunNum + 1]) + " gold";
mcw.tfCannon.textColor = 0;
mcw.btnCannon._visible = true;
}
if (main.player.levReloadSpeed > (6 + main.player.difficulty)) {
mcw.tfReloadSpeed.text = "Maximum upgrade\nlevel reached";
mcw.tfReloadSpeed.textColor = 8674878 /* 0x845E3E */;
mcw.btnReloadSpeed._visible = false;
} else if (main.player.getGold() < prcsReloadSpeed[main.player.levReloadSpeed + 1]) {
mcw.tfReloadSpeed.text = ("Not enough gold\n(" + prcsReloadSpeed[main.player.levReloadSpeed + 1]) + " needed)";
mcw.tfReloadSpeed.textColor = 11149344 /* 0xAA2020 */;
mcw.btnReloadSpeed._visible = false;
} else {
mcw.tfReloadSpeed.text = ("Faster reload:\n" + prcsReloadSpeed[main.player.levReloadSpeed + 1]) + " gold";
mcw.tfReloadSpeed.textColor = 0;
mcw.btnReloadSpeed._visible = true;
}
if (main.player.levShipMoveSpeed > (6 + main.player.difficulty)) {
mcw.tfMoveSpeed.text = "Maximum upgrade\nlevel reached";
mcw.tfMoveSpeed.textColor = 8674878 /* 0x845E3E */;
mcw.btnMoveSpeed._visible = false;
} else if (main.player.getGold() < prcsMoveSpeed[main.player.levShipMoveSpeed + 1]) {
mcw.tfMoveSpeed.text = ("Not enough gold\n(" + prcsMoveSpeed[main.player.levShipMoveSpeed + 1]) + " needed)";
mcw.tfMoveSpeed.textColor = 11149344 /* 0xAA2020 */;
mcw.btnMoveSpeed._visible = false;
} else {
mcw.tfMoveSpeed.text = ("Faster movement:\n" + prcsMoveSpeed[main.player.levShipMoveSpeed + 1]) + " gold";
mcw.tfMoveSpeed.textColor = 0;
mcw.btnMoveSpeed._visible = true;
}
if (main.player.levShipTurnSpeed > (6 + main.player.difficulty)) {
mcw.tfTurnSpeed.text = "Maximum upgrade\nlevel reached";
mcw.tfTurnSpeed.textColor = 8674878 /* 0x845E3E */;
mcw.btnTurnSpeed._visible = false;
} else if (main.player.getGold() < prcsTurnSpeed[main.player.levShipTurnSpeed + 1]) {
mcw.tfTurnSpeed.text = ("Not enough gold\n(" + prcsTurnSpeed[main.player.levShipTurnSpeed + 1]) + " needed)";
mcw.tfTurnSpeed.textColor = 11149344 /* 0xAA2020 */;
mcw.btnTurnSpeed._visible = false;
} else {
mcw.tfTurnSpeed.text = ("Faster turning:\n" + prcsTurnSpeed[main.player.levShipTurnSpeed + 1]) + " gold";
mcw.tfTurnSpeed.textColor = 0;
mcw.btnTurnSpeed._visible = true;
}
}
function upgradeArmor() {
main.sndUpgrade.start();
main.player.setGold(main.player.getGold() - prcsArmor[main.player.levArmor + 1]);
main.player.levArmor++;
renderUpgrades();
}
function upgradeReloadSpeed() {
main.sndUpgrade.start();
main.player.setGold(main.player.getGold() - prcsReloadSpeed[main.player.levReloadSpeed + 1]);
main.player.levReloadSpeed++;
renderUpgrades();
}
function upgradeCrew() {
main.sndUpgrade.start();
main.player.setGold(main.player.getGold() - prcsCrew[main.player.levCrew + 1]);
main.player.levCrew++;
renderUpgrades();
}
function upgradeCannon() {
main.sndUpgrade.start();
main.player.setGold(main.player.getGold() - prcsCannon[main.player.levGunNum + 1]);
main.player.levGunNum++;
renderUpgrades();
}
function upgradeFirepower() {
main.sndUpgrade.start();
main.player.setGold(main.player.getGold() - prcsFirepower[main.player.levFirepower + 1]);
main.player.levFirepower++;
renderUpgrades();
}
function upgradeMoveSpeed() {
main.sndUpgrade.start();
main.player.setGold(main.player.getGold() - prcsMoveSpeed[main.player.levShipMoveSpeed + 1]);
main.player.levShipMoveSpeed++;
renderUpgrades();
}
function upgradeTurnSpeed() {
main.sndUpgrade.start();
main.player.setGold(main.player.getGold() - prcsTurnSpeed[main.player.levShipTurnSpeed + 1]);
main.player.levShipTurnSpeed++;
renderUpgrades();
}
function undoChanges() {
main.player.levArmor = levArmorInitial;
main.player.levCrew = levCrewInitial;
main.player.levFirepower = levFirepowerInitial;
main.player.levGunNum = levCannonInitial;
main.player.levReloadSpeed = levReloadSpeedInitial;
main.player.levShipMoveSpeed = levMoveSpeedInitial;
main.player.levShipTurnSpeed = levTurnSpeedInitial;
main.player.setGold(getGoldInitial());
isChangeMade = false;
renderUpgrades();
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
if (screenStep < 30) {
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -480, 480, 30);
} else if (screenStep < 50) {
mcw.btnDone._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep - 30, 521, -100, 20);
mcw.btnSave._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep - 30, 521, -100, 20);
mcw.mcGold._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep - 30, 521, -100, 20);
} else {
screenStep = 0;
mcw.btnUndo._y = 404;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
if (screenStep < 20) {
mcw.btnDone._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 421, 100, 20);
mcw.btnSave._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 421, 100, 20);
mcw.mcGold._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 421, 100, 20);
mcw.btnUndo._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 404, 100, 20);
} else if (screenStep < 50) {
mcw.btnDone._y = -600;
mcw.btnSave._y = -600;
mcw.mcGold._y = -600;
mcw.btnUndo._y = -600;
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep - 20, 0, -480, 30);
} else {
screenStep = 0;
main.switchScreenVisibility();
}
}
if (isChangeMade) {
btnUndoStep = Math.min(15, btnUndoStep + 1);
} else {
btnUndoStep = Math.max(0, btnUndoStep - 1);
}
mcw.btnUndo._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(btnUndoStep, -50, 96, 15);
}
function setGoldInitial(pNum) {
goldInitialKey = Math.floor(Math.random() * 1000000) - 500000;
goldInitial = pNum + goldInitialKey;
}
function getGoldInitial() {
return(goldInitial - goldInitialKey);
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 584 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.util.Strong2] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.util.Strong2
{
function Strong2 () {
}
static function easeIn(elapsedTime, initialValue, targetMinusInitial, duration) {
elapsedTime = elapsedTime / duration;
return((((targetMinusInitial * elapsedTime) * elapsedTime) * elapsedTime) + initialValue);
}
static function easeOut(elapsedTime, initialValue, targetMinusInitial, duration) {
elapsedTime = (elapsedTime / duration) - 1;
return((targetMinusInitial * (((elapsedTime * elapsedTime) * elapsedTime) + 1)) + initialValue);
}
static function easeInOut(elapsedTime, initialValue, targetMinusInitial, duration) {
elapsedTime = elapsedTime / (duration / 2);
if (elapsedTime < 1) {
return(((((targetMinusInitial / 2) * elapsedTime) * elapsedTime) * elapsedTime) + initialValue);
}
elapsedTime = elapsedTime - 2;
return(((targetMinusInitial / 2) * (((elapsedTime * elapsedTime) * elapsedTime) + 2)) + initialValue);
}
}
Symbol 585 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlLoadSave] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlLoadSave
{
var playerSlotDatas, mcw, main, so, screenStatus, screenStep, btnBackStep, selectedSlotNum;
function CtrlLoadSave (pMcw, pMain) {
playerSlotDatas = new Array();
var vThis = this;
mcw = pMcw;
main = pMain;
mcw.btnBack.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
if (vThis.main.currentScreen == vThis.main.SCR_LOADSAVE_LOAD) {
vThis.main.nextScreen = vThis.main.SCR_MAINMENU;
} else {
vThis.main.nextScreen = vThis.main.SCR_UPGRADES;
}
}
};
mcw.btnBack.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.mcSlot0.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.selectSlot(0);
}
};
mcw.mcSlot0.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.mcSlot1.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.selectSlot(1);
}
};
mcw.mcSlot1.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.mcSlot2.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.selectSlot(2);
}
};
mcw.mcSlot2.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnLoad.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.loadFromSlot();
}
};
mcw.btnLoad.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnSave.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.saveToSlot();
}
};
mcw.btnSave.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
so = SharedObject.getLocal("saveData");
}
function initiate() {
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.mc._visible = true;
mcw.mc._y = -480;
renderInit();
}
function renderInit() {
mcw.btnBack._x = 275;
mcw.btnLoad._x = 700;
mcw.btnSave._x = 700;
btnBackStep = 0;
if (main.currentScreen == main.SCR_LOADSAVE_LOAD) {
mcw.mcTitle.gotoAndStop(1);
mcw.tfInfo.text = "Select a saved game to load.";
} else {
mcw.mcTitle.gotoAndStop(2);
mcw.tfInfo.text = "Select a slot to save the game in.";
}
var _local2 = 0;
while (_local2 < 3) {
mcw["mcSlot" + _local2].selectGlare._visible = false;
_local2++;
}
if (so.data.slotContents == undefined) {
so.data.slotContents = new Array();
so.data.slotContents[0] = new Object();
so.data.slotContents[1] = new Object();
so.data.slotContents[2] = new Object();
}
_local2 = 0;
while (_local2 < 3) {
mcw["mcSlot" + _local2].content._visible = false;
mcw["mcSlot" + _local2].selectGlare._visible = false;
var _local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.Player();
_local3.populateFromObject(so.data.slotContents[_local2]);
if (_local3.calculateSaveChecksum() == _local3.checksum) {
playerSlotDatas[_local2] = _local3;
mcw["mcSlot" + _local2].content._visible = true;
mcw["mcSlot" + _local2].content.tfGold.text = _local3.getScore().toString();
mcw["mcSlot" + _local2].content.tfLevel.text = (_local3.currentLevel + 1).toString();
mcw["mcSlot" + _local2].content.tfDiff.text = ((_local3.difficulty == 0) ? "Captain" : (((_local3.difficulty == 1) ? "Colonel" : "Admiral")));
}
playerSlotDatas[_local2] = _local3;
_local2++;
}
mcw.btnLoad._visible = false;
mcw.btnSave._visible = false;
}
function selectSlot(pSlotNum) {
if (((main.currentScreen == main.SCR_LOADSAVE_LOAD) && (MovieClip(mcw["mcSlot" + pSlotNum]).content._visible == true)) || (main.currentScreen == main.SCR_LOADSAVE_SAVE)) {
MovieClip(mcw.mcSlot0.selectGlare)._visible = false;
MovieClip(mcw.mcSlot1.selectGlare)._visible = false;
MovieClip(mcw.mcSlot2.selectGlare)._visible = false;
MovieClip(mcw["mcSlot" + pSlotNum]).selectGlare._visible = true;
mcw.tfInfo.text = "";
if ((main.currentScreen == main.SCR_LOADSAVE_SAVE) && (MovieClip(mcw["mcSlot" + pSlotNum]).content._visible == true)) {
mcw.tfInfo.text = "(The game previously saved in the slot will be overwritten.)";
}
selectedSlotNum = pSlotNum;
if (main.currentScreen == main.SCR_LOADSAVE_LOAD) {
mcw.btnLoad._visible = true;
} else {
mcw.btnSave._visible = true;
}
}
}
function saveToSlot() {
playerSlotDatas[selectedSlotNum] = main.player;
com.gameInABottle.games.treasureOfCutlassReef.entity.Player(playerSlotDatas[selectedSlotNum]).checksum = com.gameInABottle.games.treasureOfCutlassReef.entity.Player(playerSlotDatas[selectedSlotNum]).calculateSaveChecksum();
so.data.slotContents[selectedSlotNum] = com.gameInABottle.games.treasureOfCutlassReef.entity.Player(playerSlotDatas[selectedSlotNum]).createCloneObject();
so.flush();
screenStatus = SCRST_DISAPPEARING;
main.nextScreen = main.SCR_UPGRADES;
}
function loadFromSlot() {
main.player = playerSlotDatas[selectedSlotNum];
screenStatus = SCRST_DISAPPEARING;
main.nextScreen = main.SCR_UPGRADES;
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -480, 480, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 1097, -680, 20);
mcw.btnLoad._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 1097, -680, 20);
mcw.btnSave._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 1097, -680, 20);
if (screenStep > 19) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 0, -480, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 417, 680, 20);
mcw.btnLoad._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 417, 680, 20);
mcw.btnSave._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 417, 680, 20);
if (screenStep > 19) {
screenStep = 0;
main.switchScreenVisibility();
}
}
if (mcw.btnLoad._visible || (mcw.btnSave._visible)) {
btnBackStep = Math.min(20, btnBackStep + 1);
mcw.btnBack._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(btnBackStep, 275, -77, 20);
mcw.btnLoad._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(btnBackStep, 700, -350, 20);
mcw.btnSave._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(btnBackStep, 700, -350, 20);
}
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 586 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlModeSelector] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlModeSelector
{
var main, mcw, screenStatus, screenStep;
function CtrlModeSelector (pMcw, pMain) {
main = pMain;
mcw = pMcw;
var _local2 = this;
buttonsInit();
}
function buttonsInit() {
var vThis = this;
mcw.btnDiff0.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.player.difficulty = 0;
vThis.main.nextScreen = vThis.main.SCR_MAP;
vThis.main.sndTickPress.start();
}
};
mcw.btnDiff0.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnDiff1.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.player.difficulty = 1;
vThis.main.nextScreen = vThis.main.SCR_MAP;
vThis.main.sndTickPress.start();
}
};
mcw.btnDiff1.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnDiff2.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.player.difficulty = 2;
vThis.main.nextScreen = vThis.main.SCR_MAP;
vThis.main.sndTickPress.start();
}
};
mcw.btnDiff2.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnBack.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_MAINMENU;
vThis.main.sndTickPress.start();
}
};
mcw.btnBack.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
}
function initiate() {
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.btnBack._y = 572;
mcw.btnDiff0._y = 572;
mcw.btnDiff1._y = 572;
mcw.btnDiff2._y = 572;
mcw.mcSelectDiff._y = 572;
mcw.mc._visible = true;
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
mcw.mcSelectDiff._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -140, 220, 20);
mcw.btnDiff0._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -100, 220, 20);
mcw.btnDiff1._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -100, 220, 20);
mcw.btnDiff2._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -100, 220, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 630, -300, 20);
if (screenStep > 19) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
mcw.mcSelectDiff._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 80, -220, 20);
mcw.btnDiff0._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 120, -220, 20);
mcw.btnDiff1._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 120, -220, 20);
mcw.btnDiff2._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 120, -220, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 330, 300, 20);
if (screenStep > 19) {
screenStep = 0;
main.switchScreenVisibility();
}
}
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 587 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlMainMenu] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlMainMenu
{
var main, mcw, screenStatus, screenStep;
function CtrlMainMenu (pMcw, pMain) {
main = pMain;
mcw = pMcw;
var _local2 = this;
buttonsInit();
}
function buttonsInit() {
var vThis = this;
mcw.btnTutorial.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_TUTORIAL;
vThis.main.sndTickPress.start();
}
};
mcw.btnTutorial.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnHighScores.onRelease = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.main.mcRoot.getURL(vThis.main.URL_HIGHSCORELIST, "_blank");
}
};
mcw.btnHighScores.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnNewGame.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_MODESELECTOR;
vThis.main.sndTickPress.start();
vThis.main.player = new com.gameInABottle.games.treasureOfCutlassReef.entity.Player();
}
};
mcw.btnNewGame.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnLoad.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_LOADSAVE_LOAD;
vThis.main.sndTickPress.start();
}
};
mcw.btnLoad.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnCredits.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_CREDITS;
vThis.main.sndTickPress.start();
}
};
mcw.btnCredits.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnMoreGames.onRelease = function () {
vThis.main.mcRoot.getURL(vThis.main.URL_MOREGAMES, "_blank");
};
mcw.btnMoreGames.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
}
function initiate() {
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.mc._visible = true;
mcw.mcTitle._y = -400;
mcw.btnLoad._y = 630;
mcw.btnNewGame._y = 630;
mcw.btnTutorial._y = 630;
mcw.btnHighScores._y = 690;
mcw.btnMoreGames._y = 690;
mcw.btnCredits._y = 690;
mcw.mcBottomTexts._y = 760;
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
mcw.mcTitle._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -400, 400, 20);
mcw.btnLoad._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 630, -300, 20);
mcw.btnNewGame._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 630, -300, 20);
mcw.btnTutorial._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 630, -300, 20);
mcw.btnHighScores._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 690, -300, 20);
mcw.btnMoreGames._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 690, -300, 20);
mcw.btnCredits._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 690, -300, 20);
mcw.mcBottomTexts._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 760, -300, 20);
if (screenStep > 19) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
mcw.mcTitle._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 0, -400, 20);
mcw.btnLoad._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 330, 300, 20);
mcw.btnNewGame._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 330, 300, 20);
mcw.btnTutorial._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 330, 300, 20);
mcw.btnHighScores._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 390, 300, 20);
mcw.btnMoreGames._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 390, 300, 20);
mcw.btnCredits._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 390, 300, 20);
mcw.mcBottomTexts._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 460, 300, 20);
if (screenStep > 19) {
screenStep = 0;
main.switchScreenVisibility();
}
}
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 588 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlCredits] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlCredits
{
var main, mcw, screenStatus, screenStep;
function CtrlCredits (pMcw, pMain) {
main = pMain;
mcw = pMcw;
var _local2 = this;
buttonsInit();
}
function buttonsInit() {
var vThis = this;
mcw.btnBack.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_MAINMENU;
vThis.main.sndTickPress.start();
}
};
mcw.btnBack.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.mcCreditsPlate.btnLink.onRelease = function () {
_root.getURL("http://www.gameinabottle.com/", "_blank");
};
mcw.mcCreditsPlate.btnLink.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
}
function initiate() {
mcw.btnBack._y = 572;
mcw.mcCreditsPlate._y = -400;
mcw.mc._visible = true;
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.mc._visible = true;
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
mcw.mcCreditsPlate._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -400, 476, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 572, -200, 20);
if (screenStep > 19) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
mcw.mcCreditsPlate._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 76, -476, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 372, 200, 20);
if (screenStep > 19) {
screenStep = 0;
main.switchScreenVisibility();
}
}
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 589 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlIngame] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlIngame
{
var main, mcw, levsGunNum, levsShipMoveSpeed, levsShipTurnSpeed, levsReloadSpeed, levsFirepower, levsCannonballspeed, levsArmor, levsCrew, screenStatus, screenStep, isEngagedSoundPlaying, mcTexts, currentCannonballZ, pirateCannonballs, enemyCannonballs, keyListener, shipDatas, pirateShip, enemyShips, isPirateshipShootingUp, goldPlunderedOnLevel, pirateCannonballsShot, pirateCannonballsHit, pirateShipEngagementLevel, timer, enemyShipZCount, flagMakeCannonSound, status, isOutcomeVictory, pnlLevelInfo, pnlOutcome;
function CtrlIngame (pMcw, pMain) {
main = pMain;
mcw = pMcw;
levsGunNum = new Array(24, 30, 36, 42, 48, 60, 72, 80, 88, 100, 104, 108, 116, 180, 360, 360, 360);
levsShipMoveSpeed = new Array(1.1, 1.2, 1.3, 1.4, 1.5, 1.55, 1.8, 2, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3, 5, 5);
levsShipTurnSpeed = new Array(1.4, 1.5, 1.6, 1.7, 1.8, 2, 2.2, 2.4, 2.45, 2.48, 2.5, 2.6, 2.7, 3, 5, 5, 5);
levsReloadSpeed = new Array(3, 4, 5, 6, 7, 8, 9, 12, 14, 16, 16, 16, 17, 18, 19, 60, 100);
levsFirepower = new Array(1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2, 2.2, 2.4, 2.4, 2.4, 2.5, 2.6, 2.7, 12, 16);
levsCannonballspeed = new Array(2.2, 2.35, 2.5, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6);
levsArmor = new Array(10, 11, 12, 13, 14, 15, 16, 18, 21, 22, 23, 24, 25, 26, 27, 100, 120);
levsCrew = new Array(40, 48, 56, 64, 72, 80, 96, 120, 140, 160, 180, 210, 240, 300, 360, 480, 600);
}
function initiate() {
mcw.mcSea.gotoAndStop((main.player.currentLevel % 4) + 1);
screenStatus = SCRST_APPEARING;
screenStep = 0;
isEngagedSoundPlaying = false;
mcTexts = _root.attachMovie("mcTexts", "mcTexts", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.SEA_TEXTS);
mcTexts._x = 16;
mcTexts._y = 428;
mcTexts._visible = false;
removeAllMovieClips();
currentCannonballZ = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.CANNONBALL_MIN;
pirateCannonballs = new Array();
enemyCannonballs = new Array();
var vThis = this;
keyListener = new Object();
keyListener.onKeyDown = function () {
if ((Key.getAscii() == 80) || (Key.getAscii() == 112)) {
vThis.main.switchOptions();
}
if ((Key.getAscii() == 86) || (Key.getAscii() == 118)) {
vThis.isPirateshipShootingUp = !vThis.isPirateshipShootingUp;
}
};
Key.addListener(keyListener);
resetGame();
shipDatas = new Array();
var _local3 = 0;
while (_local3 < com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[main.player.currentLevel]).shipDatas.length) {
shipDatas.push(com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData(com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[main.player.currentLevel]).shipDatas[_local3]));
_local3++;
}
mcw.mc._visible = true;
main.mcwRoot.mcIngameDoor._visible = true;
main.mcwRoot.mcIngameDoor.gotoAndPlay(2);
main.sndIngameDoorOpen.start();
}
function removeAllMovieClips() {
pirateShip.mc.removeMovieClip();
pirateShip.battleWheel.removeMovieClip();
var _local2 = 0;
while (_local2 < pirateCannonballs.length) {
com.gameInABottle.games.treasureOfCutlassReef.entity.Cannonball(pirateCannonballs[_local2]).mc.removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < enemyCannonballs.length) {
com.gameInABottle.games.treasureOfCutlassReef.entity.Cannonball(enemyCannonballs[_local2]).mc.removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < enemyShips.length) {
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).infoPanel.removeMovieClip();
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).battleWheel.removeMovieClip();
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).mc.removeMovieClip();
_local2++;
}
}
function resetGame() {
isPirateshipShootingUp = true;
goldPlunderedOnLevel = 0;
pirateCannonballsShot = 0;
pirateCannonballsHit = 0;
pirateShipEngagementLevel = 0;
timer = 0;
enemyShipZCount = 0;
pirateShip = new com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(this);
pirateShip.isOwnedByPlayer = true;
pirateShip.mc = _root.attachMovie("mcShip2", "pirateShip", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.PIRATESHIP);
pirateShip.x = 320;
pirateShip.y = 400;
pirateShip.mc._x = -320;
pirateShip.mc._y = -400;
pirateShip.isRotating = false;
pirateShip.rotation = 0;
var _local3 = new Array();
_local3.push(new flash.filters.DropShadowFilter(30, 45, 0, 100, 20, 20, 0.6, 1, false, false));
pirateShip.mc.filters = _local3;
pirateShip.mc.sailFront.gotoAndStop(2);
pirateShip.mc.sailRear.gotoAndStop(2);
pirateShip.mc.mast1.sail1.gotoAndStop(2);
pirateShip.mc.mast1.sail2.gotoAndStop(2);
pirateShip.mc.mast2.sail1.gotoAndStop(2);
pirateShip.mc.mast2.sail2.gotoAndStop(2);
pirateShip.mc.mast3.sail1.gotoAndStop(2);
pirateShip.mc.mast3.sail2.gotoAndStop(2);
pirateShip.mc._xscale = (pirateShip.mc._yscale = 50 + (5 * levsArmor[main.player.levArmor]));
var _local4 = new Color(pirateShip.mc.mast1.flag);
_local4.setRGB(0);
_local4 = new Color(pirateShip.mc.mast2.flag);
_local4.setRGB(0);
_local4 = new Color(pirateShip.mc.mast3.flag);
_local4.setRGB(0);
pirateShip.mc.mast1.flag.gotoAndPlay(Math.floor(Math.random() * 12) + 1);
pirateShip.mc.mast2.flag.gotoAndPlay(Math.floor(Math.random() * 12) + 1);
pirateShip.mc.mast3.flag.gotoAndPlay(Math.floor(Math.random() * 12) + 1);
pirateShip.hpMax = 100 * levsArmor[main.player.levArmor];
pirateShip.hp = pirateShip.hpMax;
pirateShip.armor = levsArmor[main.player.levArmor];
pirateShip.cannonsNum = levsGunNum[main.player.levGunNum];
pirateShip.speedMax = levsShipMoveSpeed[main.player.levShipMoveSpeed];
pirateShip.turnSpeedMax = levsShipTurnSpeed[main.player.levShipTurnSpeed];
pirateShip.reloadSpeed = levsReloadSpeed[main.player.levReloadSpeed];
pirateShip.firePower = levsFirepower[main.player.levFirepower];
pirateShip.crewNum = levsCrew[main.player.levCrew];
pirateShip.cannonballSpeed = levsCannonballspeed[main.player.levFirepower];
pirateShip.battleWheel = _root.attachMovie("pirateWheelShell", ("battleWheel" + com.gameInABottle.games.treasureOfCutlassReef.constants.Z.BATTLEWHEEL_MIN) + enemyShipZCount, com.gameInABottle.games.treasureOfCutlassReef.constants.Z.BATTLEWHEEL_MIN + (enemyShipZCount++));
pirateShip.battleWheel._alpha = 0;
pirateShip.battleWheel._x = -400;
pirateShip.battleWheel._width = 80;
pirateShip.battleWheel._height = 80;
pirateShip.cannonsLoadedNum = pirateShip.cannonsNum;
enemyShips = new Array();
flagMakeCannonSound = true;
main.sndAmbient.start(0, 9999);
status = ST_PLAYING;
mcTexts.tfGold.text = "";
mcTexts.tfCrew.text = "";
mcTexts.tfCannons.text = "";
mcTexts.tfShip.text = "";
mcTexts._visible = true;
}
function createShip(pShipData) {
var _local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(this);
_local3.hp = 100 * levsArmor[pShipData.armorLevel];
_local3.hpMax = _local3.hp;
_local3.armor = levsArmor[pShipData.armorLevel];
_local3.crewNum = levsCrew[pShipData.crewNumLevel];
_local3.firePower = levsFirepower[pShipData.firePowerLevel];
_local3.cannonballSpeed = levsCannonballspeed[pShipData.firePowerLevel];
_local3.cannonsNum = levsGunNum[pShipData.cannonsNumLevel];
_local3.cannonsLoadedNum = levsGunNum[pShipData.cannonsNumLevel];
_local3.speed = 0;
_local3.speedMax = levsShipMoveSpeed[pShipData.speedMaxLevel];
_local3.speedMaxOriginal = _local3.speedMax;
_local3.turnSpeed = 0;
_local3.turnSpeedMax = levsShipTurnSpeed[pShipData.turnSpeedMaxLevel];
if (pShipData.isWeakened) {
_local3.crewNum = Math.floor(_local3.crewNum / 2);
_local3.hpMax = Math.floor(_local3.hpMax / 2);
_local3.hp = Math.floor(_local3.hp / 2);
_local3.cannonsNum = Math.floor(_local3.cannonsNum / 2);
_local3.cannonsLoadedNum = Math.floor(_local3.cannonsLoadedNum / 2);
}
_local3.goldCarried = pShipData.goldCarried;
_local3.reloadSpeed = levsReloadSpeed[pShipData.reloadSpeedLevel];
_local3.status = _local3.ST_AI_INCOMING;
_local3.rotation = 90;
_local3.isRotating = true;
_local3.isFiring = false;
_local3.isEngaged = false;
_local3.isOwnedByPlayer = false;
_local3.x = ((pShipData.x == 0) ? ((Math.random() * 400) + 120) : (pShipData.x));
if (pShipData.sailType == pShipData.ST_FINAL_MINION) {
_local3.y = 190;
} else {
_local3.y = -150;
}
_local3.data = pShipData;
_local3.mc = _root.attachMovie("mcShip" + pShipData.hullType, ("enemyShip" + com.gameInABottle.games.treasureOfCutlassReef.constants.Z.ENEMYSHIP_MIN) + enemyShipZCount, com.gameInABottle.games.treasureOfCutlassReef.constants.Z.ENEMYSHIP_MIN + (enemyShipZCount++));
_local3.mc._y = -600;
_local3.infoPanel = _root.attachMovie("shipInfoPanel", ("shipInfoPanel" + com.gameInABottle.games.treasureOfCutlassReef.constants.Z.INFOPANEL_MIN) + enemyShipZCount, com.gameInABottle.games.treasureOfCutlassReef.constants.Z.INFOPANEL_MIN + (enemyShipZCount++));
_local3.infoPanel._y = -600;
_local3.infoPanel.tfGold.text = _local3.goldCarried;
_local3.infoPanel.tfCannons.text = _local3.cannonsNum;
_local3.infoPanel.tfCrew.text = _local3.crewNum;
_local3.infoPanel.tfShip.text = _local3.hp;
_local3.battleWheel = _root.attachMovie("pirateWheelShell", ("battleWheel" + com.gameInABottle.games.treasureOfCutlassReef.constants.Z.BATTLEWHEEL_MIN) + enemyShipZCount, com.gameInABottle.games.treasureOfCutlassReef.constants.Z.BATTLEWHEEL_MIN + (enemyShipZCount++));
_local3.battleWheel._x = -400;
var _local5 = new Array(60, 80, 100, 120, 150);
_local3.battleWheel._width = _local5[pShipData.hullType - 1];
_local3.battleWheel._height = _local5[pShipData.hullType - 1];
var _local6 = new Array();
_local6.push(new flash.filters.DropShadowFilter(30, 45, 0, 100, 20, 20, 0.6, 1, false, false));
_local3.mc.filters = _local6;
if (pShipData.sailType == pShipData.ST_DOT1) {
_local3.mc.mast1.sail1.gotoAndStop("reg1");
_local3.mc.mast2.sail1.gotoAndStop("reg1");
_local3.mc.mast3.sail1.gotoAndStop("reg1");
} else if (pShipData.sailType == pShipData.ST_DOT2) {
_local3.mc.mast1.sail1.gotoAndStop("reg1");
_local3.mc.mast1.sail2.gotoAndStop("reg1");
_local3.mc.mast2.sail1.gotoAndStop("reg1");
_local3.mc.mast2.sail2.gotoAndStop("reg1");
_local3.mc.mast3.sail1.gotoAndStop("reg1");
_local3.mc.mast3.sail2.gotoAndStop("reg1");
} else if (pShipData.sailType == pShipData.ST_DOT3) {
_local3.mc.mast1.sail1.gotoAndStop("reg2");
_local3.mc.mast1.sail2.gotoAndStop("reg1");
_local3.mc.mast2.sail1.gotoAndStop("reg2");
_local3.mc.mast2.sail2.gotoAndStop("reg1");
_local3.mc.mast3.sail1.gotoAndStop("reg2");
_local3.mc.mast3.sail2.gotoAndStop("reg1");
} else if (pShipData.sailType == pShipData.ST_DOT4) {
_local3.mc.mast1.sail1.gotoAndStop("reg2");
_local3.mc.mast1.sail2.gotoAndStop("reg2");
_local3.mc.mast2.sail1.gotoAndStop("reg2");
_local3.mc.mast2.sail2.gotoAndStop("reg2");
_local3.mc.mast3.sail1.gotoAndStop("reg2");
_local3.mc.mast3.sail2.gotoAndStop("reg2");
} else if (pShipData.sailType == pShipData.ST_DOT5) {
_local3.mc.mast1.sail1.gotoAndStop("reg3");
_local3.mc.mast1.sail2.gotoAndStop("reg2");
_local3.mc.mast2.sail1.gotoAndStop("reg3");
_local3.mc.mast2.sail2.gotoAndStop("reg2");
_local3.mc.mast3.sail1.gotoAndStop("reg3");
_local3.mc.mast3.sail2.gotoAndStop("reg2");
} else if (pShipData.sailType == pShipData.ST_DOT6) {
_local3.mc.mast1.sail1.gotoAndStop("reg3");
_local3.mc.mast1.sail2.gotoAndStop("reg3");
_local3.mc.mast2.sail1.gotoAndStop("reg3");
_local3.mc.mast2.sail2.gotoAndStop("reg3");
_local3.mc.mast3.sail1.gotoAndStop("reg3");
_local3.mc.mast3.sail2.gotoAndStop("reg3");
} else if (pShipData.sailType == pShipData.ST_DOWNRED_BLANK) {
_local3.mc.mast1.sail1.gotoAndStop("red");
_local3.mc.mast2.sail1.gotoAndStop("red");
_local3.mc.mast3.sail1.gotoAndStop("red");
} else if (pShipData.sailType == pShipData.ST_DOWNRED_DOT1) {
_local3.mc.mast1.sail1.gotoAndStop("red");
_local3.mc.mast2.sail1.gotoAndStop("red");
_local3.mc.mast3.sail1.gotoAndStop("red");
_local3.mc.mast1.sail2.gotoAndStop("reg1");
_local3.mc.mast2.sail2.gotoAndStop("reg1");
_local3.mc.mast3.sail2.gotoAndStop("reg1");
} else if (pShipData.sailType == pShipData.ST_DOWNRED_DOT2) {
_local3.mc.mast1.sail1.gotoAndStop("red");
_local3.mc.mast2.sail1.gotoAndStop("red");
_local3.mc.mast3.sail1.gotoAndStop("red");
_local3.mc.mast1.sail2.gotoAndStop("reg2");
_local3.mc.mast2.sail2.gotoAndStop("reg2");
_local3.mc.mast3.sail2.gotoAndStop("reg2");
} else if (pShipData.sailType == pShipData.ST_DOWNRED_DOT3) {
_local3.mc.mast1.sail1.gotoAndStop("red");
_local3.mc.mast2.sail1.gotoAndStop("red");
_local3.mc.mast3.sail1.gotoAndStop("red");
_local3.mc.mast1.sail2.gotoAndStop("reg3");
_local3.mc.mast2.sail2.gotoAndStop("reg3");
_local3.mc.mast3.sail2.gotoAndStop("reg3");
} else if (pShipData.sailType == pShipData.ST_UPRED_BLANK) {
_local3.mc.mast1.sail2.gotoAndStop("red");
_local3.mc.mast2.sail2.gotoAndStop("red");
_local3.mc.mast3.sail2.gotoAndStop("red");
} else if (pShipData.sailType == pShipData.ST_UPRED_DOT1) {
_local3.mc.mast1.sail2.gotoAndStop("red");
_local3.mc.mast2.sail2.gotoAndStop("red");
_local3.mc.mast3.sail2.gotoAndStop("red");
_local3.mc.mast1.sail1.gotoAndStop("reg1");
_local3.mc.mast2.sail1.gotoAndStop("reg1");
_local3.mc.mast3.sail1.gotoAndStop("reg1");
} else if (pShipData.sailType == pShipData.ST_UPRED_DOT2) {
_local3.mc.mast1.sail2.gotoAndStop("red");
_local3.mc.mast2.sail2.gotoAndStop("red");
_local3.mc.mast3.sail2.gotoAndStop("red");
_local3.mc.mast1.sail1.gotoAndStop("reg2");
_local3.mc.mast2.sail1.gotoAndStop("reg2");
_local3.mc.mast3.sail1.gotoAndStop("reg2");
} else if (pShipData.sailType == pShipData.ST_UPRED_DOT3) {
_local3.mc.mast1.sail2.gotoAndStop("red");
_local3.mc.mast2.sail2.gotoAndStop("red");
_local3.mc.mast3.sail2.gotoAndStop("red");
_local3.mc.mast1.sail1.gotoAndStop("reg3");
_local3.mc.mast2.sail1.gotoAndStop("reg3");
_local3.mc.mast3.sail1.gotoAndStop("reg3");
} else if (pShipData.sailType == pShipData.ST_PIRATEHUNTER1) {
_local3.mc.mast1.sail1.gotoAndStop("black");
_local3.mc.mast1.sail2.gotoAndStop("black");
_local3.mc.mast2.sail1.gotoAndStop("red");
_local3.mc.mast2.sail2.gotoAndStop("red");
_local3.mc.mast3.sail1.gotoAndStop("black");
_local3.mc.mast3.sail2.gotoAndStop("black");
_local3.mc.sailFront.gotoAndStop(2);
_local3.mc.sailRear.gotoAndStop(2);
} else if (pShipData.sailType == pShipData.ST_PIRATEHUNTER2) {
_local3.mc.mast2.sail1.gotoAndStop("black");
_local3.mc.mast2.sail2.gotoAndStop("black");
_local3.mc.sailFront.gotoAndStop(2);
_local3.mc.sailRear.gotoAndStop(2);
} else if (pShipData.sailType == pShipData.ST_PIRATEHUNTER3) {
_local3.mc.mast1.sail1.gotoAndStop("black");
_local3.mc.mast1.sail2.gotoAndStop("black");
_local3.mc.mast2.sail1.gotoAndStop("red");
_local3.mc.mast2.sail2.gotoAndStop("red");
_local3.mc.mast3.sail1.gotoAndStop("red");
_local3.mc.mast3.sail2.gotoAndStop("red");
_local3.mc.sailFront.gotoAndStop(2);
_local3.mc.sailRear.gotoAndStop(2);
} else if (pShipData.sailType == pShipData.ST_PIRATEHUNTER4) {
_local3.mc.mast1.sail1.gotoAndStop("red");
_local3.mc.mast1.sail2.gotoAndStop("red");
_local3.mc.mast2.sail1.gotoAndStop("black");
_local3.mc.mast2.sail2.gotoAndStop("black");
_local3.mc.mast3.sail1.gotoAndStop("red");
_local3.mc.mast3.sail2.gotoAndStop("red");
_local3.mc.sailFront.gotoAndStop(2);
_local3.mc.sailRear.gotoAndStop(2);
} else if (pShipData.sailType == pShipData.ST_FINAL_MINION) {
_local3.mc.mast1.sail1.gotoAndStop("red");
_local3.mc.mast1.sail2.gotoAndStop("red");
_local3.mc.mast2.sail1.gotoAndStop("red");
_local3.mc.mast2.sail2.gotoAndStop("red");
_local3.mc.mast3.sail1.gotoAndStop("red");
_local3.mc.mast3.sail2.gotoAndStop("red");
_local3.mc.sailFront.gotoAndStop(3);
} else if (pShipData.sailType == pShipData.ST_BOSS) {
_local3.mc.mast1.sail1.gotoAndStop("boss" + (main.player.currentLevel + 1));
_local3.mc.mast1.sail2.gotoAndStop("boss" + (main.player.currentLevel + 1));
_local3.mc.mast2.sail1.gotoAndStop("boss" + (main.player.currentLevel + 1));
_local3.mc.mast2.sail2.gotoAndStop("boss" + (main.player.currentLevel + 1));
_local3.mc.mast3.sail1.gotoAndStop("boss" + (main.player.currentLevel + 1));
_local3.mc.mast3.sail2.gotoAndStop("boss" + (main.player.currentLevel + 1));
_local3.mc.sailFront.gotoAndStop(3);
} else {
_local3.mc.mast1.flag._visible = false;
_local3.mc.mast2.flag._visible = false;
_local3.mc.mast3.flag._visible = false;
}
if ((((pShipData.sailType == pShipData.ST_PIRATEHUNTER1) || (pShipData.sailType == pShipData.ST_PIRATEHUNTER2)) || (pShipData.sailType == pShipData.ST_PIRATEHUNTER3)) || (pShipData.sailType == pShipData.ST_PIRATEHUNTER4)) {
var _local7 = new Color(_local3.mc.mast1.flag);
_local7.setRGB(0);
_local7 = new Color(_local3.mc.mast2.flag);
_local7.setRGB(0);
_local7 = new Color(_local3.mc.mast3.flag);
_local7.setRGB(0);
} else {
_local3.mc.mast1.flag._alpha = 80;
_local3.mc.mast2.flag._alpha = 80;
_local3.mc.mast3.flag._alpha = 80;
if (pShipData.sailType == pShipData.ST_BOSS) {
_local3.mc.mast1.flag._xscale = 110;
_local3.mc.mast1.flag._yscale = 110;
_local3.mc.mast2.flag._xscale = 110;
_local3.mc.mast2.flag._yscale = 110;
_local3.mc.mast3.flag._xscale = 110;
_local3.mc.mast3.flag._yscale = 110;
} else {
_local3.mc.mast1.flag._xscale = 80;
_local3.mc.mast1.flag._yscale = 80;
_local3.mc.mast2.flag._xscale = 80;
_local3.mc.mast2.flag._yscale = 80;
_local3.mc.mast3.flag._xscale = 80;
_local3.mc.mast3.flag._yscale = 80;
}
}
_local3.mc.mast1.flag.gotoAndPlay(Math.floor(Math.random() * 12) + 1);
_local3.mc.mast2.flag.gotoAndPlay(Math.floor(Math.random() * 12) + 1);
_local3.mc.mast3.flag.gotoAndPlay(Math.floor(Math.random() * 12) + 1);
enemyShips.push(_local3);
}
function endGameWithDefeat() {
isOutcomeVictory = false;
status = ST_OVER_PANEL_APPEARING;
timer = 0;
main.sndCloseCombat.stop();
Key.removeListener(keyListener);
}
function endGameWithVictory() {
isOutcomeVictory = true;
status = ST_OVER_PANEL_APPEARING;
timer = 0;
Key.removeListener(keyListener);
}
function doEnterFrame() {
main.vfxEngine.doEnterFrame();
if (screenStatus == SCRST_APPEARING) {
screenStep++;
if (screenStep > 40) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
if (screenStep == 39) {
stopAllSounds();
main.sndIngameDoorCloseEnd.start();
}
if (screenStep > 40) {
screenStep = 0;
removeAllMovieClips();
main.switchScreenVisibility();
}
}
timer++;
if (status == ST_PLAYING) {
setEngagementLevel(-1);
if (timer == 10) {
pnlLevelInfo = main.mcRoot.attachMovie("mcLevelInfoPanel", "mcLevelInfoPanel", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.LEVELINFOPANEL);
pnlLevelInfo._y = 150;
pnlLevelInfo._x = 700;
pnlLevelInfo.tfShipNum.text = shipDatas.length + " enemy ships on the horizon...";
pnlLevelInfo.tfFlagshipName.text = com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[main.player.currentLevel]).flagShipName;
} else if (timer < 41) {
} else if (timer < 71) {
pnlLevelInfo._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(timer - 41, 660, -560, 30);
} else if (timer < 131) {
} else if (timer < 161) {
pnlLevelInfo._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(timer - 131, 100, -560, 30);
} else if (timer == 161) {
pnlLevelInfo.removeMovieClip();
}
var _local4 = 0;
while (_local4 < enemyShips.length) {
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local4]).doEnterFrame();
_local4++;
}
avoidShipCollision();
}
if (main.preferences.quality == 3) {
if (Math.random() > 0.992) {
main.vfxEngine.createCloud();
}
}
var _local4 = 0;
while (_local4 < pirateCannonballs.length) {
var _local2 = pirateCannonballs[_local4];
_local2.fly();
if ((((_local2.x < 0) || (_local2.x > 640)) || (_local2.y < 0)) || (_local2.y > 480)) {
_local2.mc.removeMovieClip();
pirateCannonballs.splice(_local4, 1);
_local4--;
} else if (status == ST_PLAYING) {
var _local3 = 0;
while (_local3 < enemyShips.length) {
if (((com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).ST_AI_WRECK) && (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).ST_AI_PLUNDERED)) && (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).ST_AI_DISAPPEARING)) {
if (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).mc.hitTest(_local2.x, _local2.y, true)) {
_local2.mc.removeMovieClip();
main.vfxEngine.createBlast(_local2.x, _local2.y);
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).sufferDamage(_local2.firepower);
pirateCannonballsHit++;
pirateCannonballs.splice(_local4, 1);
_local4--;
break;
}
}
_local3++;
}
}
_local4++;
}
_local4 = 0;
while (_local4 < enemyCannonballs.length) {
var _local2 = enemyCannonballs[_local4];
_local2.fly();
if ((((_local2.x < 0) || (_local2.x > 640)) || (_local2.y < 0)) || (_local2.y > 480)) {
_local2.mc.removeMovieClip();
enemyCannonballs.splice(_local4, 1);
_local4--;
} else if (status == ST_PLAYING) {
if (pirateShip.mc.hitTest(_local2.x, _local2.y, true)) {
_local2.mc.removeMovieClip();
main.vfxEngine.createBlast(_local2.x, _local2.y);
pirateShip.sufferDamage(_local2.firepower);
enemyCannonballs.splice(_local4, 1);
_local4--;
}
var _local3 = 0;
while (_local3 < enemyShips.length) {
if (com.gameInABottle.games.treasureOfCutlassReef.entity.Cannonball(enemyCannonballs[_local4]).originShip != enemyShips[_local3]) {
if (((com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).ST_AI_WRECK) && (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).ST_AI_PLUNDERED)) && (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).ST_AI_DISAPPEARING)) {
if (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).mc.hitTest(_local2.x, _local2.y, true)) {
_local2.mc.removeMovieClip();
main.vfxEngine.createBlast(_local2.x, _local2.y);
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local3]).sufferDamage(_local2.firepower / 8);
enemyCannonballs.splice(_local4, 1);
_local4--;
break;
}
}
}
_local3++;
}
}
_local4++;
}
if (status == ST_PLAYING) {
if (timer < 20) {
mcTexts._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(timer, 508, -80, 20);
}
pirateShip.doEnterFrame();
if (pirateShip.isFiring) {
mcTexts.tfCannons.text = ("Firing (" + pirateShip.cannonsLoadedNum) + " cannons to fire)";
TextField(mcTexts.tfCannons).textColor = 16711680 /* 0xFF0000 */;
} else {
mcTexts.tfCannons.text = ((pirateShip.cannonsLoadedNum == 1) ? (("1/" + pirateShip.cannonsNum) + " cannon ready to fire") : ((((pirateShip.cannonsLoadedNum + "/") + pirateShip.cannonsNum) + " cannons ready to fire") + (isPirateshipShootingUp ? "(up)" : "(down)")));
TextField(mcTexts.tfCannons).textColor = 16777215 /* 0xFFFFFF */;
}
mcTexts.tfGold.text = main.player.getGold() + " gold in coffers";
mcTexts.tfCrew.text = pirateShip.crewNum + " pirates on board";
mcTexts.tfShip.text = (("Ship integrity: " + pirateShip.hp) + " of ") + pirateShip.hpMax;
_local4 = 0;
while (_local4 < shipDatas.length) {
if (com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData(shipDatas[_local4]).spawnTime <= timer) {
createShip(shipDatas[_local4]);
shipDatas.splice(_local4, 1);
}
_local4++;
}
} else if (status == ST_OVER_PANEL_APPEARING) {
if (timer < 20) {
mcTexts._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(timer, 428, 80, 20);
} else if (timer == 20) {
var vThis = this;
if (isOutcomeVictory) {
var _local7 = pirateCannonballsHit / pirateCannonballsShot;
pnlOutcome = main.mcRoot.attachMovie("outcomePanelVictory", "pnlOutcome", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.LEVELOUTCOMEPANEL);
pnlOutcome.tfGoldPlundered.text = goldPlunderedOnLevel;
pnlOutcome.tfCannonballs.text = ((pirateCannonballsHit + " / ") + pirateCannonballsShot) + ((pirateCannonballsShot == 0) ? "" : ((" (" + Math.round(_local7 * 100)) + "%)"));
var _local5 = 0;
if (pirateCannonballsShot == 0) {
_local5 = 2500;
pnlOutcome.tfAccuracyBonusTtl.text = "All ammo saved:";
pnlOutcome.tfAccuracyBonus.text = "**2500**";
} else if (_local7 >= 0.7) {
_local5 = Math.round(((main.player.currentLevel + 1) * 1000) * _local7);
pnlOutcome.tfAccuracyBonusTtl.text = "Accuracy bonus:";
pnlOutcome.tfAccuracyBonus.text = _local5.toString();
} else {
_local5 = 0;
pnlOutcome.tfAccuracyBonusTtl.text = "No accuracy bonus.";
pnlOutcome.tfAccuracyBonus.text = "0";
}
pnlOutcome.tfGoldEarned.text = goldPlunderedOnLevel + _local5;
main.player.setScore(main.player.getScore() + _local5);
main.player.setGold(main.player.getGold() + _local5);
pnlOutcome.tfTotalScore.text = main.player.getScore().toString();
pnlOutcome.btnOk.onPress = function () {
if (vThis.status == vThis.ST_OVER_IDLE) {
vThis.status = vThis.ST_CLOSING;
vThis.timer = 0;
if (vThis.main.player.currentLevel == (vThis.main.staticData.levels.length - 1)) {
vThis.main.nextScreen = vThis.main.SCR_ENDGAME;
} else {
vThis.main.nextScreen = vThis.main.SCR_UPGRADES;
}
vThis.main.player.currentLevel++;
}
};
} else {
pnlOutcome = main.mcRoot.attachMovie("outcomePanelDefeat", "pnlOutcome", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.LEVELOUTCOMEPANEL);
pnlOutcome.tfCause.text = ((pirateShip.hp < 1) ? "Your ship has been destroyed." : "You have been killed.");
pnlOutcome.btnOk.onPress = function () {
if (vThis.status == vThis.ST_OVER_IDLE) {
vThis.status = vThis.ST_CLOSING;
vThis.timer = 0;
vThis.main.nextScreen = vThis.main.SCR_MAINMENU;
}
};
pnlOutcome.tfFinalScore.text = main.player.getScore().toString();
pnlOutcome.btnSubmit.onRelease = function () {
if (vThis.status == vThis.ST_OVER_IDLE) {
if (vThis.pnlOutcome.tfName.text != "") {
vThis.main.sndTickPress.start();
var _local1 = new LoadVars();
var _local2 = new LoadVars();
_local2.onHTTPStatus = function (pStatus) {
vThis.pnlOutcome.mcServerStatus.gotoAndStop(3);
};
_local1.name = vThis.pnlOutcome.tfName.text;
_local1.score = vThis.main.player.getScore();
_local1.chk = vThis.main.player.calculateHighScoreChecksum(vThis.pnlOutcome.tfName.text, vThis.main.player.getScore(), vThis.main.player.currentLevel, vThis.main.player.difficulty);
_local1.level = vThis.main.player.currentLevel;
_local1.difficulty = vThis.main.player.difficulty;
_local1.sendAndLoad(vThis.main.URL_HIGHSCORELIST, _local2, "GET");
vThis.pnlOutcome.mcServerStatus.gotoAndStop(2);
}
}
};
pnlOutcome.btnSubmit.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
}
pnlOutcome._x = 133;
pnlOutcome._y = -500;
} else if (timer < 50) {
pnlOutcome._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(timer - 20, -250, 408, 30);
} else if (timer == 50) {
status = ST_OVER_IDLE;
}
} else if (status == ST_CLOSING) {
pnlOutcome._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(timer, 158, -408, 30);
if (timer > 30) {
status = ST_IDLE;
main.mcwRoot.mcIngameDoor.gotoAndPlay(42);
main.sndIngameDoorClose.start();
screenStatus = SCRST_DISAPPEARING;
}
} else if (status == ST_OVER_IDLE) {
}
}
function returnToMainMenu() {
status = ST_IDLE;
main.mcwRoot.mcIngameDoor.gotoAndPlay(42);
main.sndIngameDoorClose.start();
screenStatus = SCRST_DISAPPEARING;
main.nextScreen = main.SCR_MAINMENU;
}
function destroyShip(pShip) {
var _local2 = 0;
while (_local2 < enemyShips.length) {
if (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]) == pShip) {
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).infoPanel.removeMovieClip();
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).battleWheel.removeMovieClip();
enemyShips[_local2].mc.removeMovieClip();
enemyShips.splice(_local2, 1);
checkForGameContinuity();
}
_local2++;
}
}
function checkForGameContinuity() {
var _local4 = true;
var _local6 = true;
var _local2 = 0;
while (_local2 < enemyShips.length) {
if (((com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).ST_AI_PLUNDERED) && (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).ST_AI_WRECK)) && (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).status != com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).ST_AI_DISAPPEARING)) {
_local4 = false;
if (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).hp > (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).hpMax * 0.3)) {
_local6 = false;
}
}
_local2++;
}
if (shipDatas.length < 1) {
if (_local4) {
var _local5 = false;
_local2 = 0;
while (_local2 < enemyShips.length) {
if (com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).status == com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).ST_AI_WRECK) {
com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).status = com.gameInABottle.games.treasureOfCutlassReef.entity.Ship(enemyShips[_local2]).ST_AI_PLUNDERED;
_local5 = true;
}
_local2++;
}
if (_local5) {
main.sndPlunder.start();
}
}
if (enemyShips.length < 1) {
endGameWithVictory();
}
} else if (_local4 || (_local6)) {
var _local3 = 999999999 /* 0x3B9AC9FF */;
_local2 = 0;
while (_local2 < shipDatas.length) {
if (com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData(shipDatas[_local2]).spawnTime < _local3) {
_local3 = com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData(shipDatas[_local2]).spawnTime;
}
_local2++;
}
timer = _local3;
}
}
function createPirateCannonball(pX, pY, pSpeedX, pSpeedY, pFirepower) {
var _local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.Cannonball(pX, pY, pSpeedX, pSpeedY, _root.attachMovie("mcCannonball", "cannonball" + currentCannonballZ, currentCannonballZ, null), pFirepower, pirateShip);
currentCannonballZ++;
if (currentCannonballZ > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.CANNONBALL_MIN + 10000)) {
currentCannonballZ = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.CANNONBALL_MIN;
}
pirateCannonballs.push(_local3);
main.vfxEngine.createWhiteSmoke(pX, pY);
if (flagMakeCannonSound) {
flagMakeCannonSound = false;
main["sndCannon" + (Math.floor(Math.random() * 12) + 1)].start();
} else {
flagMakeCannonSound = true;
}
pirateCannonballsShot++;
}
function createEnemyCannonball(pX, pY, pSpeedX, pSpeedY, pFirepower, pOrigin) {
var _local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.Cannonball(pX, pY, pSpeedX, pSpeedY, _root.attachMovie("mcCannonball", "cannonball" + currentCannonballZ, currentCannonballZ, null), pFirepower, pOrigin);
currentCannonballZ++;
if (currentCannonballZ > (com.gameInABottle.games.treasureOfCutlassReef.constants.Z.CANNONBALL_MIN + 10000)) {
currentCannonballZ = com.gameInABottle.games.treasureOfCutlassReef.constants.Z.CANNONBALL_MIN;
}
enemyCannonballs.push(_local3);
main.vfxEngine.createWhiteSmoke(pX, pY);
if (flagMakeCannonSound) {
flagMakeCannonSound = false;
main["sndCannon" + (Math.floor(Math.random() * 6) + 7)].start();
} else {
flagMakeCannonSound = true;
}
}
function setEngagementLevel(pNum) {
pirateShipEngagementLevel = Math.max(0, Math.min(5, pirateShipEngagementLevel + pNum));
if ((pirateShipEngagementLevel > 0) && (!isEngagedSoundPlaying)) {
isEngagedSoundPlaying = true;
main.sndCloseCombat.start(0, 9999);
} else if ((pirateShipEngagementLevel == 0) && (isEngagedSoundPlaying)) {
isEngagedSoundPlaying = false;
main.sndCloseCombat.stop();
}
}
function avoidShipCollision() {
var _local3 = 0;
while (_local3 < enemyShips.length) {
var _local2 = 0;
while (_local2 < enemyShips.length) {
if (_local3 != _local2) {
var _local5 = Math.sqrt(((enemyShips[_local3].x - enemyShips[_local2].x) * (enemyShips[_local3].x - enemyShips[_local2].x)) + ((2.5 * (enemyShips[_local3].y - enemyShips[_local2].y)) * (enemyShips[_local3].y - enemyShips[_local2].y)));
var _local4 = ((_local5 > 60) ? 0 : (((60 - _local5) / 60) * 1.5));
if (_local4 > 0) {
if (enemyShips[_local3].y > enemyShips[_local2].y) {
enemyShips[_local3].y = enemyShips[_local3].y + _local4;
enemyShips[_local2].y = enemyShips[_local2].y - _local4;
} else {
enemyShips[_local3].y = enemyShips[_local3].y - _local4;
enemyShips[_local2].y = enemyShips[_local2].y + _local4;
}
}
}
_local2++;
}
_local3++;
}
}
var ST_PLAYING = "ST_PLAYING";
var ST_OVER_PANEL_APPEARING = "ST_OVER_PANEL_APPEARING";
var ST_OVER_IDLE = "ST_OVER_IDLE";
var ST_CLOSING = "ST_CLOSING";
var ST_IDLE = "ST_IDLE";
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 590 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.entity.Ship] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.entity.Ship
{
var ctrl, speed, turnSpeed, reloadedness, isOwnedByPlayer, cannonsLoadedNum, isFiring, turnSpeedMax, speedMax, rotation, x, y, mc, cannonballSpeed, firePower, reloadSpeed, crewNum, cannonsNum, data, status, infoPanel, goldCarried, battleWheel, hp, armor, speedMaxOriginal, hpMax;
function Ship (pCtrl) {
ctrl = pCtrl;
speed = 0;
turnSpeed = 0;
reloadedness = 120;
}
function doEnterFrame() {
if (isOwnedByPlayer) {
if ((Key.isDown(32) || (Key.isDown(17))) || (Key.isDown(com.gameInABottle.games.treasureOfCutlassReef.util.KeyCode.F))) {
if (cannonsLoadedNum > 0) {
isFiring = true;
} else {
isFiring = false;
}
} else {
isFiring = false;
}
if (Key.isDown(37) || (Key.isDown(com.gameInABottle.games.treasureOfCutlassReef.util.KeyCode.A))) {
turnSpeed = Math.max(-turnSpeedMax, turnSpeed - 0.08);
} else if (Key.isDown(39) || (Key.isDown(com.gameInABottle.games.treasureOfCutlassReef.util.KeyCode.D))) {
turnSpeed = Math.min(turnSpeedMax, turnSpeed + 0.08);
} else {
var _local8 = Math.abs(Math.max(0, turnSpeed - 0.08));
if (turnSpeed < 0) {
turnSpeed = -_local8;
} else {
turnSpeed = _local8;
}
}
if (Key.isDown(38) || (Key.isDown(com.gameInABottle.games.treasureOfCutlassReef.util.KeyCode.W))) {
speed = Math.min(speedMax, speed + 0.08);
} else {
speed = Math.max(0, speed - 0.08);
}
rotation = rotation + turnSpeed;
if (rotation > 180) {
rotation = rotation - 360;
} else if (rotation < -180) {
rotation = rotation + 360;
}
x = x + (speed * Math.cos((rotation * Math.PI) / 180));
y = y + (speed * Math.sin((rotation * Math.PI) / 180));
if (x > 550) {
x = x - ((x - 550) * 0.08);
}
if (x < 90) {
x = x + ((90 - x) * 0.08);
}
if (y > 420) {
y = y - ((y - 420) * 0.12);
}
if (y < 90) {
y = y + ((90 - y) * 0.08);
}
if (isFiring) {
var _local7 = 0;
var _local6 = 0;
var _local11 = 0;
var _local10 = 0;
var _local9 = (Math.random() * 0.6) - 0.3;
var _local3 = (ctrl.isPirateshipShootingUp ? 1 : -1);
if (rotation < -90) {
_local7 = (x + ((((mc._xscale / 100) * mc._width) * _local9) * Math.cos((rotation * Math.PI) / 180))) - (((((mc._xscale / 100) * _local3) * mc.hull._height) / 2) * Math.sin((rotation * Math.PI) / 180));
_local6 = (y + ((((mc._xscale / 100) * mc._width) * _local9) * Math.sin((rotation * Math.PI) / 180))) - (((((mc._xscale / 100) * _local3) * mc.hull._height) / 2) * (-Math.cos((rotation * Math.PI) / 180)));
vSpeedX = (-1 * (cannonballSpeed + 0.5)) * Math.sin((rotation * Math.PI) / 180);
vSpeedY = (cannonballSpeed + 0.5) * Math.cos((rotation * Math.PI) / 180);
} else if (rotation < 0) {
_local7 = (x + ((((mc._xscale / 100) * mc._width) * _local9) * Math.cos((rotation * Math.PI) / 180))) + (((((mc._xscale / 100) * _local3) * mc.hull._height) / 2) * Math.sin((rotation * Math.PI) / 180));
_local6 = (y + ((((mc._xscale / 100) * mc._width) * _local9) * Math.sin((rotation * Math.PI) / 180))) + (((((mc._xscale / 100) * _local3) * mc.hull._height) / 2) * (-Math.cos((rotation * Math.PI) / 180)));
vSpeedX = (cannonballSpeed + 0.5) * Math.sin((rotation * Math.PI) / 180);
vSpeedY = (-(cannonballSpeed + 0.5)) * Math.cos((rotation * Math.PI) / 180);
} else if (rotation < 90) {
_local7 = (x + ((((mc._xscale / 100) * mc._width) * _local9) * Math.cos((rotation * Math.PI) / 180))) + (((((mc._xscale / 100) * _local3) * mc.hull._height) / 2) * Math.sin((rotation * Math.PI) / 180));
_local6 = (y + ((((mc._xscale / 100) * mc._width) * _local9) * Math.sin((rotation * Math.PI) / 180))) + (((((mc._xscale / 100) * _local3) * mc.hull._height) / 2) * (-Math.cos((rotation * Math.PI) / 180)));
vSpeedX = (cannonballSpeed + 0.5) * Math.sin((rotation * Math.PI) / 180);
vSpeedY = (-(cannonballSpeed + 0.5)) * Math.cos((rotation * Math.PI) / 180);
} else {
_local7 = (x + ((((mc._xscale / 100) * mc._width) * _local9) * Math.cos((rotation * Math.PI) / 180))) - (((((mc._xscale / 100) * _local3) * mc.hull._height) / 2) * Math.sin((rotation * Math.PI) / 180));
_local6 = (y + ((((mc._xscale / 100) * mc._width) * _local9) * Math.sin((rotation * Math.PI) / 180))) - (((((mc._xscale / 100) * _local3) * mc.hull._height) / 2) * (-Math.cos((rotation * Math.PI) / 180)));
vSpeedX = (-(cannonballSpeed + 0.5)) * Math.sin((rotation * Math.PI) / 180);
vSpeedY = (cannonballSpeed + 0.5) * Math.cos((rotation * Math.PI) / 180);
}
vSpeedX = vSpeedX * _local3;
vSpeedY = vSpeedY * _local3;
ctrl.createPirateCannonball(_local7, _local6, vSpeedX, vSpeedY, firePower);
cannonsLoadedNum--;
} else if (Math.random() < 0.4) {
if ((Math.random() * 1000) < (crewNum * reloadSpeed)) {
cannonsLoadedNum = Math.min(cannonsLoadedNum + 1, cannonsNum);
}
}
} else {
y = y + Math.max(0.07, (y / 480) * data.deltaY);
if (status == ST_AI_DISAPPEARING) {
mc._alpha = mc._alpha - 0.65;
if (mc._alpha < 1) {
ctrl.destroyShip(this);
}
}
if (status == ST_AI_PLUNDERED) {
infoPanel.goldenFrame._visible = true;
var _local5 = Math.max(0, Math.floor(goldCarried * 0.2));
if (_local5 < 10) {
_local5 = goldCarried;
}
goldCarried = goldCarried - _local5;
infoPanel.tfGold.text = goldCarried;
ctrl.main.player.setScore(ctrl.main.player.getScore() + _local5);
ctrl.main.player.setGold(ctrl.main.player.getGold() + _local5);
ctrl.goldPlunderedOnLevel = ctrl.goldPlunderedOnLevel + _local5;
if (goldCarried == 0) {
status = ST_AI_DISAPPEARING;
mc.hull.gotoAndStop(6);
mc.mast1._visible = false;
mc.mast2._visible = false;
mc.mast3._visible = false;
mc.sailFront._visible = false;
mc.sailRear._visible = false;
if (data.hullType == 1) {
var _local2 = 0;
while (_local2 < 5) {
ctrl.main.vfxEngine.createBlast((x + (Math.random() * 20)) - 10, (y + (Math.random() * 20)) - 10);
_local2++;
}
} else if (data.hullType == 2) {
var _local2 = 0;
while (_local2 < 6) {
ctrl.main.vfxEngine.createBlast((x + (Math.random() * 28)) - 14, (y + (Math.random() * 28)) - 14);
_local2++;
}
} else if (data.hullType == 3) {
var _local2 = 0;
while (_local2 < 7) {
ctrl.main.vfxEngine.createBlast((x + (Math.random() * 34)) - 17, (y + (Math.random() * 34)) - 17);
_local2++;
}
} else if (data.hullType == 4) {
var _local2 = 0;
while (_local2 < 9) {
ctrl.main.vfxEngine.createBlast((x + (Math.random() * 40)) - 20, (y + (Math.random() * 40)) - 20);
_local2++;
}
} else if (data.hullType == 5) {
var _local2 = 0;
while (_local2 < 15) {
ctrl.main.vfxEngine.createBlast((x + (Math.random() * 60)) - 30, (y + (Math.random() * 60)) - 30);
_local2++;
}
}
ctrl.main.vfxEngine.createInfoPanelBlast(infoPanel._x, infoPanel._y);
ctrl.main.sndBlastBig.start();
infoPanel.removeMovieClip();
}
}
if ((y > 480) && (status != ST_AI_DISAPPEARING)) {
status = ST_AI_DISAPPEARING;
ctrl.main.vfxEngine.createInfoPanelBlast(infoPanel._x, infoPanel._y);
infoPanel.removeMovieClip();
}
if (Math.sqrt(((x - ctrl.pirateShip.x) * (x - ctrl.pirateShip.x)) + ((y - ctrl.pirateShip.y) * (y - ctrl.pirateShip.y))) < 90) {
if ((status == ST_AI_PLUNDERED) || (status == ST_AI_DISAPPEARING)) {
} else if (status == ST_AI_WRECK) {
ctrl.main.sndPlunder.start();
status = ST_AI_PLUNDERED;
} else if (status != ST_AI_ENGAGED) {
status = ST_AI_ENGAGED;
ctrl.setEngagementLevel(1);
infoPanel.redFrame._visible = true;
}
}
if (status == ST_AI_ENGAGED) {
ctrl.setEngagementLevel(2);
if (Math.sqrt(((x - ctrl.pirateShip.x) * (x - ctrl.pirateShip.x)) + ((y - ctrl.pirateShip.y) * (y - ctrl.pirateShip.y))) > 110) {
if (((rotation == 0) || (rotation == 180)) || (rotation == -180)) {
status = ST_AI_MOVING;
} else {
status = ST_AI_TURNING;
}
ctrl.setEngagementLevel(-1);
infoPanel.redFrame._visible = false;
} else {
x = x + Math.max(-1.5, Math.min(1.5, 0.025 * (ctrl.pirateShip.x - x)));
sufferEngagedDamage();
ctrl.pirateShip.sufferEngagedDamage();
}
}
if (((status != ST_AI_WRECK) && (status != ST_AI_PLUNDERED)) && (status != ST_AI_DISAPPEARING)) {
if (y > (ctrl.pirateShip.y - 50)) {
y = y - ((50 - (ctrl.pirateShip.y - y)) / 200);
}
}
if ((data.sailType == data.ST_BOSS) && (ctrl.main.player.currentLevel == 11)) {
y = Math.min(110, y);
}
if (status == ST_AI_INCOMING) {
y = y + speedMax;
if (y > 75) {
status = ST_AI_TURNING_TO_H;
}
}
if (status == ST_AI_SHOOTING) {
reloadedness = 0;
var _local9 = 0.6 * (Math.random() - 0.3);
var _local7 = 0;
var _local6 = 0;
if ((rotation < 90) && (rotation > -90)) {
_local7 = (x + ((mc._width * Math.cos((rotation * Math.PI) / 180)) * _local9)) - ((mc.hull._height / 2) * Math.sin((rotation * Math.PI) / 180));
_local6 = y + ((mc.hull._height / 2) * Math.cos((rotation * Math.PI) / 180));
var vSpeedX = (cannonballSpeed * Math.sin((rotation * Math.PI) / 180));
var vSpeedY = (cannonballSpeed * Math.cos((rotation * Math.PI) / 180));
} else {
_local7 = (x + ((mc._width * Math.cos((rotation * Math.PI) / 180)) * _local9)) - ((mc.hull._height / 2) * Math.sin((rotation * Math.PI) / 180));
_local6 = y - ((mc.hull._height / 2) * Math.cos((rotation * Math.PI) / 180));
var vSpeedX = (cannonballSpeed * Math.sin((rotation * Math.PI) / 180));
var vSpeedY = (cannonballSpeed * (-Math.cos((rotation * Math.PI) / 180)));
}
ctrl.createEnemyCannonball(_local7, _local6, vSpeedX, vSpeedY, firePower, this);
cannonsLoadedNum--;
if (cannonsLoadedNum < 1) {
status = ST_AI_MOVING;
}
} else {
reloadedness++;
if ((Math.random() * 1000) < (crewNum * reloadSpeed)) {
if (Math.random() < 0.4) {
cannonsLoadedNum = Math.min(cannonsLoadedNum + 1, cannonsNum);
}
}
}
if ((status == ST_AI_MOVING) || (status == ST_AI_SHOOTING)) {
speed = Math.min(speed + 0.04, speedMax);
} else {
speed = Math.max(speed - 0.05, 0);
}
if ((((status == ST_AI_MOVING) || (status == ST_AI_SHOOTING)) || (status == ST_AI_TURNING)) || (status == ST_AI_ENGAGED)) {
if (rotation > 90) {
x = x - speed;
if (x < data.xMin) {
status = ST_AI_TURNING;
}
} else {
x = x + speed;
if (x > data.xMax) {
status = ST_AI_TURNING;
}
}
}
if (status == ST_AI_MOVING) {
if ((Math.random() < 0.055) || ((data.sailType == data.ST_BOSS) && (ctrl.main.player.currentLevel == 11))) {
if ((((reloadedness > 119) && (cannonsLoadedNum > 0)) && (cannonsLoadedNum == cannonsNum)) && (Math.abs(x - ctrl.pirateShip.x) < Math.min(55, (ctrl.pirateShip.y - y) + 10))) {
if (y < ctrl.pirateShip.y) {
var _local4 = true;
var _local2 = 0;
while (_local2 < ctrl.enemyShips.length) {
if ((ctrl.enemyShips[_local2] != this) && (Math.abs(x - ctrl.enemyShips[_local2].x) < Math.min(55, (ctrl.enemyShips[_local2].y - y) + 10))) {
_local4 = false;
}
_local2++;
}
if (_local4) {
status = ST_AI_SHOOTING;
}
}
}
}
}
if (status == ST_AI_TURNING) {
turnSpeed = Math.min(turnSpeed + 1, turnSpeedMax);
if (x < data.xMin) {
rotation = rotation - turnSpeed;
if (rotation < 0) {
rotation = 0;
turnSpeed = 0;
status = ST_AI_MOVING;
}
} else {
rotation = rotation + turnSpeed;
if (rotation > 180) {
rotation = 180;
turnSpeed = 0;
status = ST_AI_MOVING;
}
}
}
if (status == ST_AI_TURNING_TO_H) {
turnSpeed = Math.min(turnSpeed + 1, turnSpeedMax);
if ((rotation < 0) && (rotation > -90)) {
rotation = rotation + turnSpeed;
if (rotation > 0) {
rotation = 0;
turnSpeed = 0;
status = ST_AI_MOVING;
}
} else if (rotation < 90) {
rotation = rotation - turnSpeed;
if (rotation < 0) {
rotation = 0;
turnSpeed = 0;
status = ST_AI_MOVING;
}
} else {
rotation = rotation + turnSpeed;
if (rotation > 180) {
rotation = 180;
turnSpeed = 0;
status = ST_AI_MOVING;
}
}
}
}
render();
}
function render() {
mc._x = x;
mc._y = y;
mc._rotation = rotation;
if ((rotation >= 0) && (rotation < 90)) {
mc.sailFront._yscale = -(90 - rotation);
} else if ((rotation >= 90) && (rotation <= 180)) {
mc.sailFront._yscale = -90 + rotation;
} else if ((rotation > -90) && (rotation < 0)) {
mc.sailFront._yscale = (-(-90 + (rotation + 90))) - 90;
} else {
mc.sailFront._yscale = 90 - (90 + (rotation + 90));
}
if ((rotation > -165) && (rotation < -15)) {
mc.mast1.sail1._xscale = 40;
mc.mast1.sail2._xscale = 40;
mc.mast2.sail1._xscale = 40;
mc.mast2.sail2._xscale = 40;
mc.mast3.sail1._xscale = 40;
mc.mast3.sail2._xscale = 40;
}
if ((rotation <= 0) && (rotation >= -15)) {
mc.mast1._rotation = rotation + 15;
mc.mast2._rotation = rotation + 15;
mc.mast3._rotation = rotation + 15;
mc.mast1.sail1._xscale = 100 + (4 * rotation);
mc.mast1.sail2._xscale = 100 + (4 * rotation);
mc.mast2.sail1._xscale = 100 + (4 * rotation);
mc.mast2.sail2._xscale = 100 + (4 * rotation);
mc.mast3.sail1._xscale = 100 + (4 * rotation);
mc.mast3.sail2._xscale = 100 + (4 * rotation);
} else if ((rotation >= 0) && (rotation <= 15)) {
mc.mast1._rotation = 15 - rotation;
mc.mast2._rotation = 15 - rotation;
mc.mast3._rotation = 15 - rotation;
} else if ((rotation >= 165) && (rotation <= 180)) {
mc.mast1._rotation = 165 - rotation;
mc.mast2._rotation = 165 - rotation;
mc.mast3._rotation = 165 - rotation;
} else if ((rotation <= -165) && (rotation >= -180)) {
mc.mast1._rotation = 165 + rotation;
mc.mast2._rotation = 165 + rotation;
mc.mast3._rotation = 165 + rotation;
mc.mast1.sail1._xscale = 100 - (4 * (rotation + 180));
mc.mast1.sail2._xscale = 100 - (4 * (rotation + 180));
mc.mast2.sail1._xscale = 100 - (4 * (rotation + 180));
mc.mast2.sail2._xscale = 100 - (4 * (rotation + 180));
mc.mast3.sail1._xscale = 100 - (4 * (rotation + 180));
mc.mast3.sail2._xscale = 100 - (4 * (rotation + 180));
} else {
mc.mast1._rotation = 0;
mc.mast2._rotation = 0;
mc.mast3._rotation = 0;
}
mc.mast1.flag._rotation = (-mc.mast1._rotation) - mc._rotation;
mc.mast2.flag._rotation = (-mc.mast1._rotation) - mc._rotation;
mc.mast3.flag._rotation = (-mc.mast1._rotation) - mc._rotation;
infoPanel._x = Math.floor(mc._x + infoPanelDistancesX[data.hullType]);
infoPanel._y = Math.floor(mc._y + infoPanelDistancesY[data.hullType]);
battleWheel._x = x;
battleWheel._y = y;
if ((isOwnedByPlayer && (ctrl.pirateShipEngagementLevel > 0)) || ((!isOwnedByPlayer) && (status == ST_AI_ENGAGED))) {
battleWheel._visible = true;
battleWheel._alpha = Math.min(100, battleWheel._alpha + 5);
} else {
battleWheel._alpha = Math.max(0, battleWheel._alpha - 5);
if (battleWheel._alpha < 1) {
battleWheel._visible = false;
}
}
}
function sufferDamage(pFirepower) {
if (isOwnedByPlayer) {
if (ctrl.main.player.difficulty == 0) {
hp = Math.max(0, hp - Math.max(3, Math.floor((((Math.random() * 9) + 4) + (3 * pFirepower)) - (5 * armor))));
} else if (ctrl.main.player.difficulty == 0) {
hp = Math.max(0, hp - Math.max(4, Math.floor((((Math.random() * 12) + 5) + (4 * pFirepower)) - (4 * armor))));
} else {
hp = Math.max(0, hp - Math.max(5, Math.floor((((Math.random() * 15) + 6) + (5 * pFirepower)) - (3 * armor))));
}
} else if (ctrl.main.player.difficulty == 0) {
hp = Math.max(0, hp - Math.max(14, Math.floor((((Math.random() * 31) + 15) + (9 * pFirepower)) - (2 * armor))));
} else if (ctrl.main.player.difficulty == 0) {
hp = Math.max(0, hp - Math.max(11, Math.floor((((Math.random() * 28) + 12) + (7 * pFirepower)) - (2 * armor))));
} else {
hp = Math.max(0, hp - Math.max(8, Math.floor((((Math.random() * 25) + 9) + (5 * pFirepower)) - (2 * armor))));
}
if (isOwnedByPlayer) {
if (ctrl.main.player.difficulty == 0) {
if (Math.random() > 0.94) {
crewNum = Math.max(0, crewNum - Math.max(1, Math.floor(Math.random() * pFirepower)));
}
if (Math.random() > 0.98) {
cannonsNum = Math.max(0, cannonsNum - 1);
cannonsLoadedNum = Math.max(0, cannonsLoadedNum - 1);
}
} else if (ctrl.main.player.difficulty == 0) {
if (Math.random() > 0.89) {
crewNum = Math.max(0, crewNum - Math.max(1, Math.floor(Math.random() * pFirepower)));
}
if (Math.random() > 0.96) {
cannonsNum = Math.max(0, cannonsNum - 1);
cannonsLoadedNum = Math.max(0, cannonsLoadedNum - 1);
}
} else {
if (Math.random() > 0.83) {
crewNum = Math.max(0, crewNum - Math.max(1, Math.floor(Math.random() * pFirepower)));
}
if (Math.random() > 0.93) {
cannonsNum = Math.max(0, cannonsNum - 1);
cannonsLoadedNum = Math.max(0, cannonsLoadedNum - 1);
}
}
} else {
if (Math.random() > 0.85) {
if (crewNum > 20) {
crewNum = Math.max(0, crewNum - Math.max(1, Math.floor(Math.random() * pFirepower)));
} else if (crewNum > 7) {
crewNum = Math.max(0, crewNum - 1);
}
}
if (Math.random() > 0.92) {
cannonsNum = Math.max(0, cannonsNum - 1);
cannonsLoadedNum = Math.max(0, cannonsLoadedNum - 1);
}
}
if (!isOwnedByPlayer) {
if (Math.random() > 0.7) {
goldCarried = Math.max(0, goldCarried - Math.round(Math.random() * 10));
}
if (Math.random() > 0.7) {
if ((data.sailType == data.ST_BOSS) && (ctrl.main.player.currentLevel == 11)) {
} else {
speedMax = speedMax * 0.982;
turnSpeedMax = turnSpeedMax * 0.993;
if ((speedMax <= (0.8 * speedMaxOriginal)) && (mc.mast3._currentframe == 1)) {
mc.mast3.gotoAndPlay(2);
}
if ((speedMax <= (0.6 * speedMaxOriginal)) && (mc.sailFront._visible == true)) {
mc.sailFront._visible = false;
}
if ((speedMax <= (0.46 * speedMaxOriginal)) && (mc.mast2._currentframe == 1)) {
mc.mast2.gotoAndPlay(2);
}
}
}
}
if (hp < 1) {
if (status == ST_AI_ENGAGED) {
infoPanel.redFrame._visible = false;
ctrl.setEngagementLevel(-1);
}
infoPanel.plate.gotoAndStop(2);
infoPanel.tfCrew._visible = false;
infoPanel.tfCannons._visible = false;
infoPanel.tfShip._visible = false;
hp = 0;
goldCarried = Math.round(goldCarried * 0.77);
mc.hull.gotoAndStop(6);
mc.sailFront._visible = false;
mc.sailRear._visible = false;
mc.mast1._visible = false;
mc.mast2._visible = false;
mc.mast3._visible = false;
var _local2 = 0;
while (_local2 < 7) {
ctrl.main.vfxEngine.createBlast((x + (Math.random() * 30)) - 15, (y + (Math.random() * 30)) - 15);
_local2++;
}
if (isOwnedByPlayer) {
ctrl.endGameWithDefeat();
} else {
status = ST_AI_WRECK;
ctrl.main.sndBlastBig.start();
ctrl.checkForGameContinuity();
}
} else if (hp < (hpMax * 0.2)) {
mc.hull.gotoAndStop(5);
} else if (hp < (hpMax * 0.4)) {
mc.hull.gotoAndStop(4);
} else if (hp < (hpMax * 0.6)) {
mc.hull.gotoAndStop(3);
} else if (hp < (hpMax * 0.8)) {
mc.hull.gotoAndStop(2);
}
if ((hp > 0) && (hp < (hpMax * 0.3))) {
ctrl.checkForGameContinuity();
}
if (!isOwnedByPlayer) {
infoPanel.tfGold.text = goldCarried;
infoPanel.tfCrew.text = crewNum;
infoPanel.tfCannons.text = cannonsNum;
infoPanel.tfShip.text = hp;
if (hp < (hpMax * 0.3)) {
infoPanel.tfShip.textColor = 16711680 /* 0xFF0000 */;
}
}
if (isOwnedByPlayer) {
if (crewNum < 1) {
ctrl.endGameWithDefeat();
}
}
ctrl.main["sndBlast" + Math.floor(Math.random() * 3)].start();
if ((((data.sailType == data.ST_BOSS) && (ctrl.main.player.currentLevel == 11)) && (hp > 2000)) && (hp < 9900)) {
if ((ctrl.enemyShips.length < 2) || ((ctrl.enemyShips.length < 3) && (Math.random() < 0.005))) {
var _local3 = new com.gameInABottle.games.treasureOfCutlassReef.entity.ShipData();
_local3.hullType = 2;
_local3.armorLevel = 6;
_local3.crewNumLevel = 6;
_local3.firePowerLevel = 6;
_local3.cannonsNumLevel = 6;
_local3.speedMaxLevel = 6;
_local3.turnSpeedMaxLevel = 6;
_local3.reloadSpeedLevel = 6;
_local3.sailType = _local3.ST_FINAL_MINION;
_local3.xMin = 80;
_local3.xMax = 560;
_local3.x = -300;
_local3.deltaY = 0.35;
_local3.goldCarried = 1000;
ctrl.createShip(_local3);
}
}
}
function sufferEngagedDamage() {
if (isOwnedByPlayer) {
if (Math.random() > 0.97) {
crewNum--;
if (crewNum < 1) {
ctrl.endGameWithDefeat();
}
}
} else if (Math.random() > 0.83) {
crewNum--;
infoPanel.tfCrew.text = crewNum;
if (crewNum < 1) {
ctrl.main.sndPlunder.start();
status = ST_AI_PLUNDERED;
ctrl.setEngagementLevel(-1);
infoPanel.redFrame._visible = false;
infoPanel.plate.gotoAndStop(2);
infoPanel.tfCrew._visible = false;
infoPanel.tfCannons._visible = false;
infoPanel.tfShip._visible = false;
}
}
}
var infoPanelDistancesX = new Array(0, 40, 50, 60, 75, 90);
var infoPanelDistancesY = new Array(0, -40, -50, -60, -75, -90);
var ST_AI_ENGAGED = "ST_ENGAGED";
var ST_AI_MOVING = "ST_MOVING";
var ST_AI_TURNING = "ST_TURNING";
var ST_AI_TURNING_TO_H = "ST_TURNING_TO_H";
var ST_AI_INCOMING = "ST_AI_INCOMING";
var ST_AI_SHOOTING = "ST_AI_SHOOTING";
var ST_AI_WRECK = "ST_AI_WRECK";
var ST_AI_PLUNDERED = "ST_AI_PLUNDERED";
var ST_AI_DISAPPEARING = "ST_AI_DISAPPEARING";
}
Symbol 591 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.util.KeyCode] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.util.KeyCode
{
function KeyCode () {
}
static var A = 65;
static var B = 66;
static var C = 67;
static var D = 68;
static var E = 69;
static var F = 70;
static var G = 71;
static var H = 72;
static var I = 73;
static var J = 74;
static var K = 75;
static var L = 76;
static var M = 77;
static var N = 78;
static var O = 79;
static var P = 80;
static var Q = 81;
static var R = 82;
static var S = 83;
static var T = 84;
static var U = 85;
static var V = 86;
static var W = 87;
static var X = 88;
static var Y = 89;
static var Z = 90;
static var NUM_0 = 48;
static var NUM_1 = 49;
static var NUM_2 = 50;
static var NUM_3 = 51;
static var NUM_4 = 52;
static var NUM_5 = 53;
static var NUM_6 = 54;
static var NUM_7 = 55;
static var NUM_8 = 56;
static var NUM_9 = 57;
}
Symbol 592 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.entity.Cannonball] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.entity.Cannonball
{
var x, y, speedX, speedY, firepower, mc, originShip;
function Cannonball (pX, pY, pSpeedX, pSpeedY, pMc, pFirepower, pOrigin) {
x = pX;
y = pY;
speedX = pSpeedX;
speedY = pSpeedY;
firepower = pFirepower;
mc = pMc;
originShip = pOrigin;
}
function fly() {
x = x + speedX;
y = y + speedY;
mc._x = x;
mc._y = y;
}
}
Symbol 593 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlTutorial] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlTutorial
{
var main, mcw, screenStatus, screenStep, currentPage, turnPageDirection, turnPageStep, btnBackOutStep, btnNextOutStep, panelIn, panelOut;
function CtrlTutorial (pMcw, pMain) {
main = pMain;
mcw = pMcw;
var _local2 = this;
buttonsInit();
}
function buttonsInit() {
var vThis = this;
mcw.btnDone.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_MAINMENU;
vThis.main.sndTickPress.start();
}
};
mcw.btnDone.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnNext.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
if ((vThis.turnPageDirection == 0) && (vThis.currentPage < vThis.PAGES_NUM)) {
vThis.turnPage(1);
vThis.main.sndTickPress.start();
}
}
};
mcw.btnNext.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnBack.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
if ((vThis.turnPageDirection == 0) && (vThis.currentPage > 1)) {
vThis.turnPage(-1);
vThis.main.sndTickPress.start();
}
}
};
mcw.btnBack.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
}
function initiate() {
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.mcPanelA._y = -480;
mcw.mcPanelB._y = -480;
mcw.btnBack._y = 600;
mcw.btnDone._y = 600;
mcw.btnNext._y = 600;
mcw.btnDone._y = 500;
mcw.mc._visible = true;
mcw.mcPanelA._x = 50;
mcw.mcPanelB._x = 690;
mcw.mcPanelA.gotoAndStop(1);
mcw.mcPanelB.gotoAndStop(1);
currentPage = 1;
turnPageDirection = 0;
turnPageStep = 0;
btnBackOutStep = 15;
btnNextOutStep = 0;
panelIn = mcw.mcPanelA;
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
mcw.mcPanelA._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -426, 480, 20);
mcw.mcPanelB._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -426, 480, 20);
mcw.btnDone._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 602, -200, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 602, -200, 20);
mcw.btnNext._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 602, -200, 20);
if (screenStep > 19) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
mcw.mcPanelA._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 54, -480, 20);
mcw.mcPanelB._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 54, -480, 20);
mcw.btnDone._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 402, 200, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 402, 200, 20);
mcw.btnNext._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 402, 200, 20);
if (screenStep > 19) {
screenStep = 0;
main.switchScreenVisibility();
}
} else if (Key.isDown(27)) {
if (screenStatus == SCRST_IDLE) {
mcw.btnDone.onPress();
}
}
if (turnPageDirection != 0) {
turnPageStep++;
if (turnPageDirection == 1) {
panelIn._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeInOut(turnPageStep, 690, -640, 20);
panelOut._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeInOut(turnPageStep, 50, -640, 20);
} else if (turnPageDirection == -1) {
panelIn._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeInOut(turnPageStep, -590, 640, 20);
panelOut._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeInOut(turnPageStep, 50, 640, 20);
}
if (turnPageStep > 19) {
turnPageDirection = 0;
turnPageStep = 0;
}
}
if (currentPage < 2) {
btnBackOutStep = Math.min(15, btnBackOutStep + 1);
} else {
btnBackOutStep = Math.max(0, btnBackOutStep - 1);
}
mcw.btnBack._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(btnBackOutStep, 28, -150, 15);
if (currentPage > (PAGES_NUM - 1)) {
btnNextOutStep = Math.min(15, btnNextOutStep + 1);
} else {
btnNextOutStep = Math.max(0, btnNextOutStep - 1);
}
mcw.btnNext._x = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(btnNextOutStep, 501, 150, 15);
if ((Key.isDown(32) || (Key.isDown(13))) || (Key.isDown(17))) {
mcw.btnNext.onPress();
}
}
function turnPage(pDirection) {
turnPageDirection = pDirection;
currentPage = currentPage + pDirection;
if (panelIn == mcw.mcPanelA) {
panelOut = mcw.mcPanelA;
panelIn = mcw.mcPanelB;
} else {
panelOut = mcw.mcPanelB;
panelIn = mcw.mcPanelA;
}
panelIn.gotoAndStop(currentPage);
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
var PAGES_NUM = 8;
}
Symbol 594 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlMap] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlMap
{
var main, mcw, screenStatus, screenStep, mapShips;
function CtrlMap (pMcw, pMain) {
main = pMain;
mcw = pMcw;
var _local2 = this;
buttonsInit();
}
function buttonsInit() {
var vThis = this;
mcw.btnStartBattle.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_INGAME;
vThis.main.sndTickPress.start();
}
};
mcw.btnStartBattle.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
}
function initiate() {
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.mc._visible = true;
mcw.mc._y = -480;
var _local2 = 0;
while (_local2 < mapShips.length) {
MovieClip(mapShips[_local2]).removeMovieClip();
_local2++;
}
mapShips = new Array();
_local2 = main.player.currentLevel;
while (_local2 < main.staticData.levels.length) {
var _local3 = mcw.mc.attachMovie("mcMapShip", "mapShip" + _local2, com.gameInABottle.games.treasureOfCutlassReef.constants.Z.MAPSHIP_MIN + _local2);
_local3._x = com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapX;
_local3._y = com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapY;
_local3._xscale = (com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).isShipFacingRight ? 100 : -100);
_local3.baseY = com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapY;
if (_local2 == main.player.currentLevel) {
var _local4 = mcw.mc.attachMovie("mcMapShip", "pirateMapShip", com.gameInABottle.games.treasureOfCutlassReef.constants.Z.MAPSHIP_MIN - 1);
_local4._x = com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapX + com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapPirRelX;
_local4._y = com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapY + com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapPirRelY;
_local4.baseY = com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapY + com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).mapPirRelY;
_local4._xscale = (com.gameInABottle.games.treasureOfCutlassReef.entity.LevelData(main.staticData.levels[_local2]).isShipFacingRight ? -100 : 100);
_local4.gotoAndStop(2);
mapShips.push(_local4);
} else {
_local3._alpha = 35;
}
mapShips.push(_local3);
_local2++;
}
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
if (screenStep < 20) {
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -480, 480, 20);
mcw.btnStartBattle._y = -100;
}
if ((screenStep < 30) && (screenStep > 9)) {
mcw.btnStartBattle._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep - 10, -100, 100, 20);
}
if (screenStep > 29) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 0, -480, 20);
if (screenStep > 19) {
screenStep = 0;
main.switchScreenVisibility();
}
} else if ((Key.isDown(32) || (Key.isDown(13))) || (Key.isDown(17))) {
mcw.btnStartBattle.onPress();
}
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 595 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlHighScores] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlHighScores
{
var main, mcw, screenStatus, screenStep;
function CtrlHighScores (pMcw, pMain) {
main = pMain;
mcw = pMcw;
var _local2 = this;
buttonsInit();
}
function buttonsInit() {
var vThis = this;
mcw.btnBack.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_MAINMENU;
}
};
mcw.btnBack.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnScroll.onPress = function () {
MovieClip(this).startDrag(false, MovieClip(this)._x, 141, MovieClip(this)._x, 341);
};
mcw.btnScroll.onRelease = function () {
MovieClip(this).stopDrag();
};
mcw.btnScroll.onReleaseOutside = function () {
MovieClip(this).stopDrag();
};
}
function initiate() {
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.mc._visible = true;
mcw.mc._y = -480;
mcw.mc._visible = true;
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -480, 480, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, 1097, -680, 20);
if (screenStep > 19) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 0, -480, 20);
mcw.btnBack._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 417, 680, 20);
if (screenStep > 19) {
screenStep = 0;
main.switchScreenVisibility();
}
}
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 596 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlEndGame] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlEndGame
{
var main, mcw, screenStatus, screenStep;
function CtrlEndGame (pMcw, pMain) {
main = pMain;
mcw = pMcw;
var _local2 = this;
buttonsInit();
}
function buttonsInit() {
var vThis = this;
mcw.btnOk.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickPress.start();
vThis.screenStatus = vThis.SCRST_DISAPPEARING;
vThis.main.nextScreen = vThis.main.SCR_MAINMENU;
}
};
mcw.btnOk.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
mcw.btnSubmit.onPress = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
if (vThis.mcw.tfName.text != "") {
vThis.main.sndTickPress.start();
var _local1 = new LoadVars();
var _local2 = new LoadVars();
_local2.onHTTPStatus = function (pStatus) {
vThis.mcw.mcServerStatus.gotoAndStop(3);
};
_local1.name = vThis.mcw.tfName.text;
_local1.score = vThis.main.player.getScore();
_local1.chk = vThis.main.player.calculateHighScoreChecksum(vThis.mcw.tfName.text, vThis.main.player.getScore(), vThis.main.player.currentLevel, vThis.main.player.difficulty);
_local1.level = vThis.main.player.currentLevel;
_local1.difficulty = vThis.main.player.difficulty;
_local1.sendAndLoad(vThis.main.URL_HIGHSCORELIST, _local2, "GET");
vThis.mcw.mcServerStatus.gotoAndStop(2);
}
}
};
mcw.btnSubmit.onRollOver = function () {
if (vThis.screenStatus == vThis.SCRST_IDLE) {
vThis.main.sndTickOver.start();
}
};
}
function initiate() {
screenStatus = SCRST_APPEARING;
screenStep = 0;
mcw.mc._visible = true;
mcw.mc._y = -480;
mcw.tfFinalScore.text = main.player.getScore().toString();
mcw.tfEpilogue.text = ((main.player.difficulty == 0) ? "You have made it! The great fleet which guarded the reef is no more! The treasure is yours! Can you beat the enemy fleet as a Colonel or Admiral? More upgrades and even more heated battles await you!" : (((main.player.difficulty == 1) ? "You have made it! The great fleet which guarded the reef is no more! The treasure is yours! You are promoted to Admiral! Do you have what it takes to destroy the toughest armada ever seen? More upgrades and even more heated battles await you!" : "You have made it! The great fleet which guarded the reef is no more! The treasure is yours! Your name will be remembered as one of the greatest pirates of history!")));
}
function doEnterFrame() {
if (screenStatus == SCRST_APPEARING) {
screenStep++;
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeOut(screenStep, -480, 480, 40);
if (screenStep > 39) {
screenStep = 0;
screenStatus = SCRST_IDLE;
}
} else if (screenStatus == SCRST_DISAPPEARING) {
screenStep++;
mcw.mc._y = com.gameInABottle.games.treasureOfCutlassReef.util.Strong2.easeIn(screenStep, 0, -480, 40);
if (screenStep > 39) {
screenStep = 0;
main.switchScreenVisibility();
}
}
}
function processHighScoreResponse(pLv) {
mcw.mcServerStatus.gotoAndStop(3);
}
var SCRST_APPEARING = "SCRST_APPEARING";
var SCRST_DISAPPEARING = "SCRST_DISAPPEARING";
var SCRST_IDLE = "SCRST_IDLE";
}
Symbol 597 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlStartup] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.ctrl.CtrlStartup
{
var main, mcw, timer;
function CtrlStartup (pMcw, pMain) {
main = pMain;
mcw = pMcw;
var _local2 = this;
buttonsInit();
mcw.mcStartupSponsor._visible = false;
mcw.mcStartupGiab._visible = false;
}
function buttonsInit() {
var _local2 = this;
}
function initiate() {
timer = 0;
mcw.mc._visible = true;
}
function doEnterFrame() {
timer++;
if (timer == 1) {
mcw.mcStartupGiab._visible = true;
mcw.mcStartupGiab.gotoAndPlay(2);
}
if (timer == 81) {
mcw.mcStartupGiab._visible = false;
}
if (timer == 91) {
mcw.mcPlate.gotoAndPlay(2);
}
if (timer == 101) {
main.isIntroOver = true;
main.nextScreen = main.SCR_MAINMENU;
main.switchScreenVisibility();
}
}
}
Symbol 598 MovieClip [__Packages.com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox] Frame 0
class com.gameInABottle.games.treasureOfCutlassReef.util.MathToolbox
{
function MathToolbox () {
}
static function convertCoord(pFromMin, pFromMax, pFrom, pToMin, pToMax) {
return(pToMin + (((pFrom - pFromMin) / (pFromMax - pFromMin)) * (pToMax - pToMin)));
}
}
Symbol 19 MovieClip [ingameDoor] Frame 1
stop();
Symbol 19 MovieClip [ingameDoor] Frame 41
stop();
Symbol 19 MovieClip [ingameDoor] Frame 81
stop();
Symbol 79 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 92 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 1
stop();
Symbol 217 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 261 MovieClip Frame 1
stop();
Symbol 265 MovieClip Frame 1
stop();
Symbol 265 MovieClip Frame 10
stop();
Symbol 269 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 80
stop();
Symbol 280 MovieClip Frame 1
stop();
Symbol 286 MovieClip [mcShipSailFront] Frame 1
stop();
Symbol 291 MovieClip [mcSailRear] Frame 1
stop();
Symbol 314 MovieClip [mcShipSailNormal] Frame 1
stop();
Symbol 332 MovieClip [mcMast] Frame 1
stop();
Symbol 332 MovieClip [mcMast] Frame 76
stop();
Symbol 336 MovieClip [mcDebris] Frame 1
stop();
Symbol 350 MovieClip [pirateWheelShell] Frame 60
gotoAndPlay (1);
Symbol 358 MovieClip [mcMapShip] Frame 1
stop();
Symbol 371 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 1
stop();
Symbol 393 MovieClip Frame 1
stop();
Symbol 404 MovieClip Frame 1
stop();
Symbol 408 MovieClip Frame 1
stop();
Symbol 410 MovieClip Frame 1
this._visible = false;
Symbol 412 MovieClip Frame 1
this._visible = false;
Symbol 449 MovieClip Frame 1
stop();
Instance of Symbol 456 MovieClip in Symbol 457 MovieClip [mcTexts] Frame 1
on (release) {
getURL ("http://www.arcadebliss.com", "_blank");
}
Symbol 485 MovieClip Frame 1
stop();
Symbol 522 MovieClip Frame 1
stop();
Symbol 536 MovieClip [cloud] Frame 1
stop();
Symbol 554 MovieClip [cheatPanelLoadSave] Frame 1
this.bigContent._visible = false;
Instance of Symbol 553 MovieClip in Symbol 554 MovieClip [cheatPanelLoadSave] Frame 1
on (press) {
if (this._parent.bigContent._visible) {
this._parent.bigContent._visible = false;
} else {
this._parent.bigContent._visible = true;
}
}
Symbol 561 MovieClip [cheatPanelInGame] Frame 1
this.bigContent._visible = false;
Instance of Symbol 553 MovieClip in Symbol 561 MovieClip [cheatPanelInGame] Frame 1
on (press) {
if (this._parent.bigContent._visible) {
this._parent.bigContent._visible = false;
} else {
this._parent.bigContent._visible = true;
}
}