Frame 8
stop();
Instance of Symbol 12 MovieClip in Frame 8
onClipEvent (enterFrame) {
total = _parent.getBytesTotal();
sofar = _parent.getBytesLoaded();
percent = Math.floor((sofar / total) * 100);
if (percent < _currentframe) {
stop();
} else {
play();
}
if (percent > 99) {
gotoAndPlay(_currentframe + 5);
}
}
Instance of Symbol 16 MovieClip in Frame 9
onClipEvent (enterFrame) {
total = _parent.getBytesTotal();
sofar = _parent.getBytesLoaded();
percent = Math.floor((sofar / total) * 100);
if (percent < _currentframe) {
stop();
} else {
play();
}
if (percent > 99) {
gotoAndPlay(_currentframe + 5);
}
}
Frame 27
gotoAndPlay ("intro");
Frame 31
mcWhirlpool.setWhirlpoolSpeed(0.2);
var aSoundIDs = new Array();
aSoundIDs.push("boat_thudID");
aSoundIDs.push("btn_press_swordID");
aSoundIDs.push("btn_rollover_swordID");
aSoundIDs.push("kraken_hitID");
aSoundIDs.push("kraken_soundID");
aSoundIDs.push("startandendID");
aSoundIDs.push("music_krakenattackID");
aSoundIDs.push("ship_smash1ID");
aSoundIDs.push("souls_picked_upID");
aSoundIDs.push("whipID");
aSoundIDs.push("music_gameplayID");
aSoundIDs.push("levelswitchID");
aSoundIDs.push("bomb_explodeID");
aSoundIDs.push("canon_fireID");
aSoundIDs.push("splashItemID");
aSoundIDs.push("kraken_hit_splashID");
aSoundIDs.push("kraken_surfaceID");
aSoundIDs.push("cockgun2ID");
var FX = (new com.digitaloutlook.gameElements.SoundFXmanager(aSoundIDs, true, mcSoundOnOff));
FX.playSound(10, false, 100, true);
FX.playSound(11);
Frame 46
stop();
Frame 47
FX.playSound(11);
Frame 64
var counter = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_gameplays/142334@x01";
trace("Counter called: " + counter);
this.loadVariables(counter);
Frame 73
stop();
Frame 74
var counter = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_gameovers/142334@x01";
trace("Counter called: " + counter);
this.loadVariables(counter);
FX.playSound(11);
Frame 85
stop();
Frame 86
var counter = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_gameovers/142334@x01";
trace("Counter called: " + counter);
this.loadVariables(counter);
FX.playSound(11);
Frame 96
stop();
Symbol 12 MovieClip Frame 1
stop();
Symbol 12 MovieClip Frame 97
stop();
_parent.play();
Symbol 12 MovieClip Frame 98
stop();
_parent.play();
Symbol 12 MovieClip Frame 99
stop();
_parent.play();
Symbol 12 MovieClip Frame 100
stop();
_parent.play();
Symbol 12 MovieClip Frame 101
stop();
_parent.play();
Symbol 12 MovieClip Frame 102
stop();
_parent.play();
Symbol 12 MovieClip Frame 103
stop();
_parent.play();
Symbol 12 MovieClip Frame 104
stop();
_parent.play();
Symbol 12 MovieClip Frame 105
stop();
_parent.play();
Symbol 12 MovieClip Frame 106
stop();
_parent.play();
Symbol 12 MovieClip Frame 107
stop();
_parent.play();
Symbol 12 MovieClip Frame 108
stop();
_parent.play();
Symbol 12 MovieClip Frame 109
stop();
_parent.play();
Symbol 12 MovieClip Frame 110
stop();
_parent.play();
Symbol 431 MovieClip [__Packages.com.digitaloutlook.sos.Kraken] Frame 0
class com.digitaloutlook.sos.Kraken extends MovieClip
{
var bStop, bIsPauzed, aTentakles, nStartCount, nShowTentacleCount, mcAllTentakles, mcGameMain, removeMovieClip, sState, stop, play, gotoAndStop, gotoAndPlay, _xscale, _yscale;
function Kraken () {
super();
}
function onLoad() {
configUI();
}
function configUI() {
bStop = false;
bIsPauzed = false;
aTentakles = new Array();
nStartCount = 10;
nShowTentacleCount = nStartCount;
var _local2 = 0;
while (_local2 < 5) {
aTentakles.push(mcAllTentakles["mcTentakle" + _local2]);
_local2++;
}
}
function krakenIsHere() {
mcGameMain.krakenIsHere();
}
function removeKraken() {
mcGameMain.krakenIsGone();
removeMovieClip();
}
function startNewLevel() {
mcGameMain.startNewLevel();
}
function onEnterFrame() {
(((bIsPauzed) ? (stop()) : (if (sState == "show") {
nShowTentacleCount--if (nShowTentacleCount <= 0) {
nShowTentacleCount = nStartCount_local2 = Math.floor(Math.random() * aTentakles.length)aTentakles[_local2].goSlap = true}
}
((!bStop) ? (play()) : (stop())))));// not popped
}
function changeState(s) {
sState = s;
if (s != "stopslappin") {
if (bIsPauzed) {
bStop = false;
gotoAndStop(sState);
} else {
bStop = false;
gotoAndPlay(sState);
}
}
}
function setGameMain(_mstr) {
mcGameMain = _mstr;
}
function shrink(_targetsize) {
var _local2 = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Regular.easeInOut, _xscale, _targetsize, 0.3, true);
var _local3 = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Regular.easeInOut, _yscale, _targetsize, 0.3, true);
}
function pauzeGame() {
bIsPauzed = true;
}
function resumeGame() {
bIsPauzed = false;
}
}
Symbol 432 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 433 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 434 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 435 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 436 MovieClip [__Packages.com.digitaloutlook.gameElements.SoundFXmanager] Frame 0
class com.digitaloutlook.gameElements.SoundFXmanager
{
var aSoundsToLoad, aSoundRefs, bSoundOn, mcToggleSound;
function SoundFXmanager (soundstoload, soundOnAtstart, soundOnOff) {
aSoundsToLoad = soundstoload;
aSoundRefs = new Array();
var _local2 = 0;
while (_local2 < aSoundsToLoad.length) {
aSoundRefs.push(new com.digitaloutlook.gameElements.SoundFX(this, aSoundsToLoad[_local2]));
_local2++;
}
bSoundOn = soundOnAtstart;
mcToggleSound = soundOnOff;
mcToggleSound.ref = this;
mcToggleSound.onRelease = function () {
this.ref.toggleSound();
};
if (bSoundOn) {
mcToggleSound.gotoAndStop("sound_on");
} else {
mcToggleSound.gotoAndStop("sound_off");
}
}
function playSound(id, wait, vol, loop) {
aSoundRefs[id].playSound(wait, vol, loop);
}
function stopSound(id) {
trace("STOPSOUND: " + id);
aSoundRefs[id].stopSound();
}
function setSoundVolume(id, n) {
aSoundRefs[id].changeVolume(n);
}
function fadeSoundVolume(id, n) {
aSoundRefs[id].fadeSoundVolume(n);
}
function stopAllSoundFX() {
var _local2 = 0;
while (_local2 < aSoundRefs.length) {
aSoundRefs[_local2].stopSound();
_local2++;
}
}
function toggleSound() {
bSoundOn = !bSoundOn;
var _local2 = 0;
while (_local2 < aSoundRefs.length) {
if (bSoundOn) {
aSoundRefs[_local2].changeVolume();
} else {
aSoundRefs[_local2].changeVolume(0);
}
_local2++;
}
if (bSoundOn) {
mcToggleSound.gotoAndStop("sound_on");
} else {
mcToggleSound.gotoAndStop("sound_off");
}
}
function getSoundOn() {
return(bSoundOn);
}
}
Symbol 437 MovieClip [__Packages.com.digitaloutlook.gameElements.SoundFX] Frame 0
class com.digitaloutlook.gameElements.SoundFX
{
var sSoundID, soundManager, soundEffect, nStartVolume, nCurVol, nFadeTarget, nUpdateID;
function SoundFX (sndmanager, soundID) {
sSoundID = soundID;
soundManager = sndmanager;
var _local2 = _level0.createEmptyMovieClip(soundID + "sound", _level0.getNextHighestDepth());
soundEffect = new Sound(_local2);
soundEffect.attachSound(soundID);
}
function playSound(wait, vol, loop) {
if (wait) {
if ((soundEffect.position == soundEffect.duration) || (soundEffect.position == 0)) {
if (loop) {
soundEffect.start(0, 10000);
} else {
soundEffect.start();
}
}
} else if (loop) {
soundEffect.start(0, 10000);
} else {
soundEffect.start();
}
if (vol != undefined) {
nStartVolume = vol;
} else {
nStartVolume = 100;
}
nCurVol = nStartVolume;
if (soundManager.getSoundOn()) {
if (vol != undefined) {
soundEffect.setVolume(vol);
} else {
soundEffect.setVolume(100);
}
} else {
soundEffect.setVolume(0);
}
}
function stopSound() {
soundEffect.stop();
_level0[sSoundID + "sound"].removeMovieClip();
var _local2 = _level0.createEmptyMovieClip(sSoundID + "sound", _level0.getNextHighestDepth());
soundEffect = new Sound(_local2);
soundEffect.attachSound(sSoundID);
}
function changeVolume(n) {
if (n != undefined) {
soundEffect.setVolume(n);
nCurVol = n;
} else if (nFadeTarget != undefined) {
trace("nFadeTarget: " + nFadeTarget);
soundEffect.setVolume(nFadeTarget);
nCurVol = nFadeTarget;
} else {
trace("nStartVolume: " + nStartVolume);
soundEffect.setVolume(nStartVolume);
nCurVol = nStartVolume;
}
}
function fadeit(targetVol) {
nCurVol = nCurVol + ((targetVol - nCurVol) * 0.09);
if (Math.abs(nCurVol - targetVol) < 2) {
nCurVol = targetVol;
clearInterval(nUpdateID);
}
if (soundManager.getSoundOn()) {
soundEffect.setVolume(nCurVol);
}
}
function fadeSoundVolume(n) {
nFadeTarget = n;
nCurVol = soundEffect.getVolume();
clearInterval(nUpdateID);
nUpdateID = setInterval(this, "fadeit", 40, n);
}
}
Symbol 438 MovieClip [__Packages.com.digitaloutlook.sos.Whirlpool] Frame 0
class com.digitaloutlook.sos.Whirlpool extends MovieClip
{
var bIsPauzed, _alpha, nCount, nVarPerc, nActiveDistance, nRotationSpeed, nTargetRotSpeed, aMultiPlyers, pCentrePoint, mcOutside, mcMiddle, mcInner, mcVeryMiddle, nWhirlpoolForce;
function Whirlpool () {
super();
}
function onLoad() {
configUI();
}
function configUI() {
bIsPauzed = false;
_alpha = 0;
nCount = 0;
nVarPerc = 0.05;
nActiveDistance = 250;
nRotationSpeed = 0;
nTargetRotSpeed = 0.2;
aMultiPlyers = [0.8, 1.4, 4, 8.8];
pCentrePoint = new flash.geom.Point(300, 200);
}
function doRotation() {
mcOutside._rotation = mcOutside._rotation + (nRotationSpeed * aMultiPlyers[0]);
mcMiddle._rotation = mcMiddle._rotation + (nRotationSpeed * aMultiPlyers[1]);
mcInner._rotation = mcInner._rotation + (nRotationSpeed * aMultiPlyers[2]);
mcVeryMiddle._rotation = mcVeryMiddle._rotation + (nRotationSpeed * aMultiPlyers[3]);
}
function doVisuals() {
_alpha = nRotationSpeed * 100;
}
function onEnterFrame() {
if (!bIsPauzed) {
nCount++;
if ((nCount % 50) == 0) {
nTargetRotSpeed = nTargetRotSpeed + (nVarPerc * nRotationSpeed);
nVarPerc = nVarPerc * -1;
}
nRotationSpeed = nRotationSpeed + ((nTargetRotSpeed - nRotationSpeed) * 0.06);
nWhirlpoolForce = 5.5 * nRotationSpeed;
doRotation();
doVisuals();
}
}
function setWhirlpoolSpeed(n) {
nTargetRotSpeed = n;
}
function getWhirlpoolForce(pos, s) {
var _local2 = com.digitaloutlook.functions.MyMath.GetDistanceBetweenPoints(pCentrePoint, pos);
var _local3 = com.digitaloutlook.functions.MyMath.GetAngleFromPoints(pCentrePoint, pos);
if (_local2 < (nActiveDistance * 0.95)) {
if (_local2 < (nActiveDistance * 0.2)) {
if (s == "boat") {
_local3 = _local3 - (60 - ((1 - ((_local2 / nActiveDistance) * (_local2 / nActiveDistance))) * 40));
} else {
_local3 = _local3 - (80 - ((1 - ((_local2 / nActiveDistance) * (_local2 / nActiveDistance))) * 15));
}
} else if (s == "boat") {
_local3 = _local3 - (80 - ((1 - ((_local2 / nActiveDistance) * (_local2 / nActiveDistance))) * 25));
} else {
_local3 = _local3 - (85 - ((1 - ((_local2 / nActiveDistance) * (_local2 / nActiveDistance))) * 6));
}
var _local5 = (1 - ((_local2 / nActiveDistance) * (_local2 / nActiveDistance))) * nWhirlpoolForce;
if (s == "boat") {
_local5 = _local5 * 0.8;
}
var _local6 = _local5;
var _local9 = _local6 * Math.cos((PI / 180) * _local3);
var _local8 = _local6 * Math.sin((PI / 180) * _local3);
var _local7 = new flash.geom.Point(_local9, _local8);
} else if (s == "boat") {
var _local7 = new flash.geom.Point(0, 0);
} else {
var _local9 = 2 * Math.cos((PI / 180) * _local3);
var _local8 = 2 * Math.sin((PI / 180) * _local3);
var _local7 = new flash.geom.Point(_local9, _local8);
}
return(_local7);
}
function pauzeGame() {
bIsPauzed = true;
}
function resumeGame() {
bIsPauzed = false;
}
var PI = Math.PI;
}
Symbol 439 MovieClip [__Packages.com.digitaloutlook.functions.MyMath] Frame 0
class com.digitaloutlook.functions.MyMath
{
function MyMath () {
}
static function DegreesToRadians(__angle) {
return((__angle * Math.PI) / 180);
}
static function RadiansToDegrees(__rad) {
return((__rad * 180) / Math.PI);
}
static function GetDistanceBetweenPoints(p1, p2) {
var _local1 = p1.subtract(p2);
var _local2 = _local1.length;
return(_local2);
}
static function GetAngleFromPoints(p1, p2, rad) {
var _local1 = p1.x - p2.x;
var _local2 = p1.y - p2.y;
if (rad) {
return(Math.atan2(_local2, _local1));
}
return(RadiansToDegrees(Math.atan2(_local2, _local1)));
}
static function RemoveItemFromArray(item, _ar) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _ar.length) {
if (_ar[_local1] != item) {
_local3.push(_ar[_local1]);
}
_local1++;
}
return(_local3);
}
}
Symbol 440 MovieClip [__Packages.com.digitaloutlook.sos.GameMain] Frame 0
class com.digitaloutlook.sos.GameMain extends MovieClip
{
var mcGamePlayArea, pCentrePoint, mcPowderDisplay, mcDamageBar, mcSoulsScoreDisplay, mcSoulFlash, mcGameTimeDisplay, mcWhirlpool, mcBoat, mcHitSpace, bIsPauzed, mcCountDown, mcCannonBalls, createEmptyMovieClip, mcFloatingItemsClip, nGameSeconds, mcKrakenTime, bCountKraken, bKrakenIsShowing, bFirstRun, nSoulsPickedUp, nCurrentLevel, nPowderLeft, nCannonShotCount, aBarrels, aMines, aSouls, aCannonBalls, nStartSpeedWhirlPool, nKrakenWaitID, mcKraken, attachMovie, nShotsOnKrakenNeeded, nItemSpawnCount, nTimeUpdateID, sAfterCountDownAction, nHideKrakenWait, bSoundWasOn, barrelID, soulID, mineID;
function GameMain () {
super();
}
function onLoad() {
configUI();
}
function configUI() {
mcGamePlayArea._alpha = 0;
pCentrePoint = new flash.geom.Point(300, 200);
mcPowderDisplay = _level0.mcBottomBar.mcPowderDisplay;
mcDamageBar = _level0.mcBottomBar.mcDamageBar;
mcSoulsScoreDisplay = _level0.mcTopBar.mcSouls.mcSoulCount.mcSoulsScore;
mcSoulFlash = _level0.mcTopBar.mcSouls.soulscore_mc;
mcGameTimeDisplay = _level0.mcTopBar.mcTimePannel.mcTimeCount.mcTimeScore;
mcWhirlpool = _level0.mcWhirlpool;
mcBoat.swapDepths(15);
mcHitSpace.swapDepths(100);
mcBoat.setGameMain(this);
startGame();
}
function startGame() {
bIsPauzed = false;
_level0.FX.fadeSoundVolume(10, 0);
_level0.FX.playSound(5, true, 100, true);
_level0.FX.setSoundVolume(5, 0);
_level0.FX.fadeSoundVolume(5, 100);
mcCountDown._visible = false;
mcHitSpace._visible = false;
mcPowderDisplay.warning_mc._visible = false;
mcCannonBalls.removeMovieClip();
mcCannonBalls = createEmptyMovieClip("ballsclp", 25);
mcFloatingItemsClip.removeMovieClip();
mcFloatingItemsClip = createEmptyMovieClip("fliclp", 12);
nGameSeconds = -1;
updateGameTime();
mcKrakenTime._visible = false;
bCountKraken = false;
bKrakenIsShowing = false;
bFirstRun = true;
nSoulsPickedUp = 0;
setSoulsDisplay();
nCurrentLevel = 0;
nPowderLeft = 0;
setPowderDisplay();
nCannonShotCount = 0;
aBarrels = new Array();
aMines = new Array();
aSouls = new Array();
aCannonBalls = new Array();
nStartSpeedWhirlPool = 0.5;
mcWhirlpool.setWhirlpoolSpeed(nStartSpeedWhirlPool);
clearInterval(nKrakenWaitID);
nKrakenWaitID = setInterval(this, "showKraken", 1000);
}
function updateGameTime() {
nGameSeconds++;
var _local3 = "";
var _local4 = Math.floor(nGameSeconds / 60);
var _local2 = Math.floor(nGameSeconds - (_local4 * 60));
if (_local2 < 10) {
_local3 = (_local4 + ":0") + _local2;
} else {
_local3 = (_local4 + ":") + _local2;
}
mcGameTimeDisplay.time_txt.text = _local3;
}
function showKraken() {
if (!bKrakenIsShowing) {
_level0.FX.playSound(16);
_level0.FX.fadeSoundVolume(5, 0);
_level0.FX.playSound(6, true, 100, true);
_level0.FX.setSoundVolume(6, 0);
_level0.FX.fadeSoundVolume(6, 100);
_level0.FX.playSound(4, true, 100, true);
_level0.FX.setSoundVolume(4, 0);
_level0.FX.fadeSoundVolume(4, 100);
bKrakenIsShowing = true;
clearInterval(nKrakenWaitID);
mcKraken = attachMovie("krakenID", "kraken", 10);
mcKraken._x = pCentrePoint.x;
mcKraken._y = pCentrePoint.y;
if (!bFirstRun) {
mcHitSpace.play();
mcHitSpace._visible = true;
mcKraken.changeState("show");
}
mcKraken.setGameMain(this);
}
}
function onEnterFrame() {
if (!bIsPauzed) {
if (Key.isDown(32)) {
shootCannonBall();
}
if (bCountKraken) {
if (nShotsOnKrakenNeeded > 0) {
if (nPowderLeft == 0) {
mcPowderDisplay.warning_mc._visible = true;
if (aBarrels.length == 0) {
var _local2 = new com.digitaloutlook.sos.FloatingItem(this, mcFloatingItemsClip, "barrel", "barrelID");
aBarrels.push(_local2);
_local2 = new com.digitaloutlook.sos.FloatingItem(this, mcFloatingItemsClip, "barrel", "barrelID");
aBarrels.push(_local2);
}
}
}
}
if (nPowderLeft != 0) {
mcPowderDisplay.warning_mc._visible = false;
}
nCannonShotCount--;
}
}
function shootCannonBall() {
if ((nCannonShotCount < 0) && (nPowderLeft > 0)) {
_level0.FX.playSound(13);
var _local2 = mcCannonBalls.getNextHighestDepth();
var _local3 = new flash.geom.Point(mcBoat._x, mcBoat._y);
var _local4 = new com.digitaloutlook.sos.CannonBall(mcCannonBalls, "cannonballID", "ball" + _local2, _local2, mcBoat.getShootAngle(), _local3, 20, 35);
aCannonBalls.push(_local4);
nCannonShotCount = 12;
nPowderLeft--;
setPowderDisplay();
}
}
function newItemBurst(_type, _amount) {
clearInterval(this[_type + "ID"]);
this[_type + "items"] = _amount;
this[_type + "ID"] = setInterval(this, "showNewItem", 400, _type);
}
function showNewItem(_type) {
if (this[_type + "items"] > 0) {
switch (_type) {
case "barrel" :
var _local4 = new com.digitaloutlook.sos.FloatingItem(this, mcFloatingItemsClip, _type, "barrelID");
aBarrels.push(_local4);
break;
case "soul" :
var _local5 = new com.digitaloutlook.sos.FloatingItem(this, mcFloatingItemsClip, _type, "soulID");
aSouls.push(_local5);
break;
case "mine" :
var _local3 = new com.digitaloutlook.sos.FloatingItem(this, mcFloatingItemsClip, _type, "mineID");
aMines.push(_local3);
}
nItemSpawnCount--;
if (nItemSpawnCount == 0) {
if (nCurrentLevel == 0) {
clearInterval(nTimeUpdateID);
nTimeUpdateID = setInterval(this, "updateGameTime", 1000);
mcBoat.setAsail();
}
}
} else {
if (nItemSpawnCount == 0) {
if (nCurrentLevel == 0) {
mcKraken.changeState("disappear");
} else {
mcKraken.changeState("goafterspawn");
}
_level0.FX.playSound(16);
_level0.FX.fadeSoundVolume(6, 0);
_level0.FX.playSound(5, true, 100, true);
_level0.FX.setSoundVolume(5, 0);
_level0.FX.fadeSoundVolume(5, 100);
}
clearInterval(this[_type + "ID"]);
}
this[_type + "items"]--;
}
function setPowderDisplay() {
var _local2 = 0;
while (_local2 < MAXPOWDER) {
if (_local2 < nPowderLeft) {
mcPowderDisplay["barrel" + _local2]._visible = true;
} else {
mcPowderDisplay["barrel" + _local2]._visible = false;
}
_local2++;
}
}
function setSoulsDisplay() {
mcSoulsScoreDisplay.souls_txt.text = nSoulsPickedUp;
}
function allItemsCollected() {
mcCountDown._visible = true;
mcCountDown.gotoAndPlay(2);
mcCountDown.mcCountDownNumber._visible = false;
mcCountDown.mcBeware._visible = true;
sAfterCountDownAction = "showKraken";
}
function hideKrakenAgain() {
mcKraken.shrink(100);
clearInterval(nHideKrakenWait);
mcKraken.changeState("shot");
}
function gameOver() {
clearInterval(nHideKrakenWait);
_level0.FX.fadeSoundVolume(4, 0);
_level0.FX.fadeSoundVolume(5, 0);
_level0.FX.fadeSoundVolume(6, 0);
_level0.FX.fadeSoundVolume(10, 100);
clearInterval(nTimeUpdateID);
mcWhirlpool.setWhirlpoolSpeed(0.2);
_level0.nCurrentSoulsCount = nSoulsPickedUp;
if (_level0.nBestSoulsCount == undefined) {
_level0.nBestSoulsCount = nSoulsPickedUp;
}
if (nSoulsPickedUp > _level0.nBestSoulsCount) {
_level0.nBestSoulsCount = nSoulsPickedUp;
}
_level0.gotoAndPlay("losescreen");
}
function winGame() {
clearInterval(nHideKrakenWait);
_level0.FX.fadeSoundVolume(4, 0);
_level0.FX.fadeSoundVolume(5, 0);
_level0.FX.fadeSoundVolume(6, 0);
_level0.FX.fadeSoundVolume(10, 100);
clearInterval(nTimeUpdateID);
mcWhirlpool.setWhirlpoolSpeed(0.2);
_level0.nCurrentSoulsCount = nSoulsPickedUp;
if (_level0.nBestSoulsCount == undefined) {
_level0.nBestSoulsCount = nSoulsPickedUp;
}
if (nSoulsPickedUp > _level0.nBestSoulsCount) {
_level0.nBestSoulsCount = nSoulsPickedUp;
}
_level0.nCurrentTime = nGameSeconds;
if (_level0.nBestTime == undefined) {
_level0.nBestTime = nGameSeconds;
}
if (nGameSeconds < _level0.nBestTime) {
_level0.nBestTime = nGameSeconds;
}
_level0.gotoAndPlay("winscreen");
}
function krakenIsGone() {
_level0.FX.fadeSoundVolume(4, 0);
bKrakenIsShowing = false;
}
function krakenIsHere() {
if (bFirstRun) {
bFirstRun = false;
var _local3 = 5 - aBarrels.length;
var _local4 = 3;
var _local2 = 2 - aMines.length;
nItemSpawnCount = (_local3 + _local4) + _local2;
newItemBurst("barrel", _local3);
newItemBurst("soul", _local4);
newItemBurst("mine", _local2);
} else {
nShotsOnKrakenNeeded = TOTALSHOTSNEEDONKRAKEN;
bCountKraken = true;
}
}
function startNewLevel() {
nCurrentLevel++;
var _local3 = 5 - aBarrels.length;
var _local4 = 3;
var _local2 = 2 - aMines.length;
nItemSpawnCount = (_local3 + _local4) + _local2;
newItemBurst("barrel", _local3);
newItemBurst("soul", _local4);
newItemBurst("mine", _local2);
}
function floatingItemGone(_item, _ID) {
switch (_ID) {
case "barrelID" :
aBarrels = com.digitaloutlook.functions.MyMath.RemoveItemFromArray(_item, aBarrels);
break;
case "soulID" :
aSouls = com.digitaloutlook.functions.MyMath.RemoveItemFromArray(_item, aSouls);
break;
case "mineID" :
aMines = com.digitaloutlook.functions.MyMath.RemoveItemFromArray(_item, aMines);
}
var _local2 = aSouls.length;
if ((_local2 == 0) && (_ID == "soulID")) {
allItemsCollected();
}
}
function cannonBallGone(_item) {
aCannonBalls = com.digitaloutlook.functions.MyMath.RemoveItemFromArray(_item, aCannonBalls);
}
function boatHitByKraken() {
if (!bIsPauzed) {
var _local2 = mcDamageBar.receiveDamage(5);
_level0.FX.playSound(7, true, 100, false);
if (_local2 <= 0) {
gameOver();
}
}
}
function boatInTheMiddle(n) {
if (!bIsPauzed) {
var _local2 = mcDamageBar.receiveDamage(n);
if (_local2 <= 0) {
gameOver();
}
}
}
function krakenHitByCannonball(n) {
if (!bIsPauzed) {
_level0.FX.playSound(3);
if (bCountKraken) {
nShotsOnKrakenNeeded--;
if (nShotsOnKrakenNeeded <= 0) {
mcKraken.shrink(0);
_level0.FX.playSound(15);
bCountKraken = false;
clearInterval(nHideKrakenWait);
mcKraken.changeState("stopslappin");
mcCountDown._visible = true;
mcCountDown.gotoAndPlay(2);
mcCountDown.mcCountDownNumber._visible = true;
mcCountDown.mcBeware._visible = false;
sAfterCountDownAction = "hideKrakenAgain";
} else {
mcKraken.shrink(100 - ((TOTALSHOTSNEEDONKRAKEN - nShotsOnKrakenNeeded) * 25));
}
}
}
}
function itemPickedUp(_ID, _pos, _ob) {
if (!bIsPauzed) {
switch (_ID) {
case "barrelID" :
if (nPowderLeft < MAXPOWDER) {
nPowderLeft++;
setPowderDisplay();
}
_level0.FX.playSound(17, false, 50, false);
break;
case "soulID" :
mcSoulFlash.gotoAndPlay(2);
nSoulsPickedUp = nSoulsPickedUp + SOULSPERPICKUP;
setSoulsDisplay();
var _local2 = nStartSpeedWhirlPool + (((0.7 - nStartSpeedWhirlPool) / SOULSREQUIRED) * nSoulsPickedUp);
mcWhirlpool.setWhirlpoolSpeed(_local2);
if (nSoulsPickedUp >= SOULSREQUIRED) {
winGame();
}
_level0.FX.playSound(8);
break;
case "mineID" :
mcFloatingItemsClip.swapDepths(17);
_level0.FX.playSound(12);
var _local3 = mcDamageBar.receiveDamage(10);
if (_local3 <= 0) {
gameOver();
}
_ob.mcMine.mcExplosion.play();
}
}
}
function checkBoatPos(xpos, ypos) {
return(mcGamePlayArea.hitTest(xpos, ypos, true));
}
function mineGone() {
mcFloatingItemsClip.swapDepths(12);
}
function countdownDone() {
mcCountDown._visible = false;
switch (sAfterCountDownAction) {
case "showKraken" :
showKraken();
break;
case "hideKrakenAgain" :
hideKrakenAgain();
}
}
function pauzeGame() {
if (!bIsPauzed) {
_level0.instructions.play();
if (_level0.FX.getSoundOn()) {
bSoundWasOn = true;
_level0.FX.toggleSound();
} else {
bSoundWasOn = false;
}
bIsPauzed = true;
mcBoat.pauzeGame();
mcKraken.pauzeGame();
mcWhirlpool.pauzeGame();
var _local2 = 0;
while (_local2 < aBarrels.length) {
aBarrels[_local2].pauzeGame();
_local2++;
}
_local2 = 0;
while (_local2 < aSouls.length) {
aSouls[_local2].pauzeGame();
_local2++;
}
_local2 = 0;
while (_local2 < aMines.length) {
aMines[_local2].pauzeGame();
_local2++;
}
clearInterval(nTimeUpdateID);
}
}
function resumeGame() {
if (bSoundWasOn) {
_level0.FX.toggleSound();
}
bIsPauzed = false;
mcBoat.resumeGame();
mcKraken.resumeGame();
mcWhirlpool.resumeGame();
var _local2 = 0;
while (_local2 < aBarrels.length) {
aBarrels[_local2].resumeGame();
_local2++;
}
_local2 = 0;
while (_local2 < aSouls.length) {
aSouls[_local2].resumeGame();
_local2++;
}
_local2 = 0;
while (_local2 < aMines.length) {
aMines[_local2].resumeGame();
_local2++;
}
clearInterval(nTimeUpdateID);
nTimeUpdateID = setInterval(this, "updateGameTime", 1000);
}
function restart() {
if (bSoundWasOn) {
_level0.FX.toggleSound();
}
mcWhirlpool.resumeGame();
_level0.FX.stopSound(4);
_level0.FX.stopSound(5);
_level0.FX.stopSound(6);
clearInterval(nHideKrakenWait);
clearInterval(barrelID);
clearInterval(soulID);
clearInterval(mineID);
clearInterval(nKrakenWaitID);
clearInterval(nTimeUpdateID);
mcKraken.removeMovieClip();
mcDamageBar.resetDamage(100);
mcBoat.restart();
startGame();
}
var MAXPOWDER = 5;
var SOULSREQUIRED = 100;
var SOULSPERPICKUP = 5;
var TOTALSHOTSNEEDONKRAKEN = 3;
}
Symbol 441 MovieClip [__Packages.com.digitaloutlook.sos.FloatingItem] Frame 0
class com.digitaloutlook.sos.FloatingItem
{
var isGone, bIsPauzed, sID, mcMaster, pCentrePoint, nShootDistance, nRandomShootDist, mcWhirlpool, mcItem, sState, nActualShootDist;
function FloatingItem (_master, _createclip, _type, _linkageID) {
isGone = false;
bIsPauzed = _level0.mcGame.bIsPauzed;
sID = _linkageID;
mcMaster = _master;
pCentrePoint = new flash.geom.Point(300, 200);
if (sID == "soulID") {
nShootDistance = 160;
nRandomShootDist = 60;
} else {
nShootDistance = 100;
nRandomShootDist = 120;
}
mcWhirlpool = _level0.mcWhirlpool;
var _local2 = _createclip.getNextHighestDepth();
mcItem = _createclip.attachMovie(_linkageID, _linkageID + _local2, _local2);
mcItem._visible = false;
sState = "none";
mcItem.mcHit._alpha = 0;
mcItem.ref = this;
mcItem.onEnterFrame = function () {
this.ref.updateFloatingItemPostition();
};
showItem();
}
function showItem() {
var _local4 = Math.random() * (Math.PI*2);
var _local7 = Math.cos(_local4) * (nShootDistance + (Math.random() * nRandomShootDist));
var _local6 = Math.sin(_local4) * (nShootDistance + (Math.random() * nRandomShootDist));
var _local8 = new flash.geom.Point(_local7, _local6);
var _local2 = pCentrePoint.add(_local8);
nActualShootDist = com.digitaloutlook.functions.MyMath.GetDistanceBetweenPoints(pCentrePoint, _local2);
var _local3 = 1.2 * (nActualShootDist / nShootDistance);
var _local5 = new mx.transitions.Tween(mcItem, "_x", mx.transitions.easing.Regular.easeInOut, pCentrePoint.x, _local2.x, _local3, true);
var _local9 = new mx.transitions.Tween(mcItem, "_y", mx.transitions.easing.Regular.easeInOut, pCentrePoint.y, _local2.y, _local3, true);
_local5.ref = this;
sState = "spawn";
_local5.onMotionFinished = function () {
this.ref.itemTouchesWater();
};
mcItem._alpha = 0;
mcItem._visible = true;
}
function killMe() {
if (sID != "mineID") {
delete mcItem.onEnterFrame;
mcItem.removeMovieClip();
}
mcMaster.floatingItemGone(this, sID);
}
function itemTouchesWater() {
_level0.FX.playSound(14);
mcItem.gotoAndPlay("touchwater");
sState = "floating";
}
function updateFloatingItemPostition() {
if (!bIsPauzed) {
switch (sState) {
case "spawn" :
var _local5 = new flash.geom.Point(mcItem._x, mcItem._y);
var _local4 = com.digitaloutlook.functions.MyMath.GetDistanceBetweenPoints(pCentrePoint, _local5);
if ((_local4 / nActualShootDist) < 0.5) {
mcItem._xscale = (mcItem._yscale = (300 * (_local4 / nActualShootDist)) + 20);
var _local2 = 6000 * (_local4 / nActualShootDist);
if (_local2 > 100) {
_local2 = 100;
}
mcItem._alpha = _local2;
} else {
mcItem._xscale = (mcItem._yscale = (20 + (300 * (_local4 / nActualShootDist))) - (((_local4 / nActualShootDist) - 0.5) * 440));
mcItem._alpha = 100;
}
break;
case "floating" :
_local5 = new flash.geom.Point(mcItem._x, mcItem._y);
var _local3 = mcWhirlpool.getWhirlpoolForce(_local5);
_local4 = com.digitaloutlook.functions.MyMath.GetDistanceBetweenPoints(pCentrePoint, _local5);
if ((_local4 - 15) < SHRINKDISTANCE) {
mcItem._xscale = (mcItem._yscale = (mcItem._alpha = 100 * ((_local4 - 15) / SHRINKDISTANCE)));
if (mcItem._xscale <= 5) {
killMe();
}
}
mcItem._x = mcItem._x + _local3.x;
mcItem._y = mcItem._y + _local3.y;
if (!checkHit()) {
break;
}
pickedUp();
}
}
}
function pickedUp() {
if (!isGone) {
isGone = true;
mcMaster.itemPickedUp(sID, new flash.geom.Point(mcItem._x, mcItem._y), mcItem);
killMe();
}
}
function checkHit() {
return(mcItem.mcHit.hitTest(mcMaster.mcBoat.mcHit));
}
function pauzeGame() {
bIsPauzed = true;
}
function resumeGame() {
if (sState == "floating") {
mcItem._alpha = 100;
mcItem._xscale = (mcItem._yscale = 100);
}
bIsPauzed = false;
}
var SHRINKDISTANCE = 55;
}
Symbol 442 MovieClip [__Packages.com.digitaloutlook.sos.CannonBall] Frame 0
class com.digitaloutlook.sos.CannonBall
{
var mcMaster, bIsPauzed, pCentrePoint, mcWhirlpool, nPI, nDx, nDy, isGone, nLifeSpan, mcItem, sGoneState;
function CannonBall (clip, linkageID, clipName, _depth, startAngle, startPoint, startSpeed, lifespan) {
mcMaster = clip._parent;
bIsPauzed = _level0.mcGame.bIsPauzed;
pCentrePoint = new flash.geom.Point(300, 200);
mcWhirlpool = _level0.mcWhirlpool;
nPI = Math.PI;
nDx = startSpeed * Math.sin((nPI / 180) * startAngle);
nDy = (-startSpeed) * Math.cos((nPI / 180) * startAngle);
isGone = false;
nLifeSpan = lifespan;
mcItem = clip.attachMovie(linkageID, clipName, _depth);
mcItem._x = startPoint.x;
mcItem._y = startPoint.y;
mcItem.ref = this;
mcItem.onEnterFrame = function () {
this.ref.update();
};
}
function update() {
if (!bIsPauzed) {
var _local3 = new flash.geom.Point(mcItem._x, mcItem._y);
if (!isGone) {
nDx = nDx * 0.9;
nDy = nDy * 0.9;
mcItem._x = mcItem._x + nDx;
mcItem._y = mcItem._y + nDy;
nLifeSpan--;
var _local5 = com.digitaloutlook.functions.MyMath.GetDistanceBetweenPoints(pCentrePoint, _local3);
if (nLifeSpan == 0) {
doSplash();
} else if ((Math.abs(nDx) < 0.3) && (Math.abs(nDy) < 0.3)) {
doSplash();
}
if (!(checkHit() === "kraken")) {
} else {
var _local2 = 1 - (_local5 / 200);
if (_local2 < 0) {
_local2 = 0;
} else if (_local2 > 1) {
_local2 = 1;
}
mcMaster.krakenHitByCannonball(_local2);
doExplode();
}
} else {
switch (sGoneState) {
case "splash" :
var _local4 = mcWhirlpool.getWhirlpoolForce(_local3);
var _local5 = com.digitaloutlook.functions.MyMath.GetDistanceBetweenPoints(pCentrePoint, _local3);
if ((_local5 - 15) < SHRINKDISTANCE) {
mcItem._xscale = (mcItem._yscale = (mcItem.mcItem = 100 * ((_local5 - 15) / SHRINKDISTANCE)));
if (mcItem._xscale <= 5) {
delete mcItem.onEnterFrame;
mcItem.removeMovieClip();
}
}
mcItem._x = mcItem._x + _local4.x;
mcItem._y = mcItem._y + _local4.y;
break;
case "explosion" :
mcItem._x = mcItem._x + (nDx * 0.1);
mcItem._y = mcItem._y + (nDy * 0.1);
}
}
}
}
function doSplash() {
_level0.FX.playSound(14);
isGone = true;
sGoneState = "splash";
mcItem.gotoAndPlay("splash");
mcMaster.cannonBallGone(this);
}
function doExplode() {
isGone = true;
sGoneState = "explosion";
mcItem.gotoAndPlay("boom");
mcMaster.cannonBallGone(this);
}
function killMe() {
mcItem.removeMovieClip();
mcMaster.cannonBallGone(this);
}
function checkHit() {
if (mcMaster.mcBoat.mcHit.hitTest(mcItem)) {
var _local2 = "boat";
} else if (mcMaster.mcKraken.hitTest(mcItem._x, mcItem._y, true)) {
var _local2 = "kraken";
} else {
var _local2 = "nothing";
}
return(_local2);
}
function pauzeGame() {
bIsPauzed = true;
}
function resumeGame() {
bIsPauzed = false;
}
var SHRINKDISTANCE = 70;
}
Symbol 443 MovieClip [__Packages.com.digitaloutlook.gameElements.DamageIndicator] Frame 0
class com.digitaloutlook.gameElements.DamageIndicator extends MovieClip
{
var mcMover, createEmptyMovieClip, getNextHighestDepth, nTotalFrames, nDamage, nStartDamage, gotoAndStop;
function DamageIndicator () {
super();
}
function onLoad() {
configUI();
}
function configUI() {
mcMover = createEmptyMovieClip("mover", getNextHighestDepth());
nTotalFrames = 100;
resetDamage(100);
}
function receiveDamage(n) {
nDamage = nDamage - n;
if (nDamage < 0) {
nDamage = 0;
}
var _local2 = (1 - (nDamage / nStartDamage)) * nTotalFrames;
var _local3 = new mx.transitions.Tween(mcMover, "_x", mx.transitions.easing.Regular.easeOut, mcMover._x, _local2, 10);
return(nDamage);
}
function getFinalDamage() {
return(nDamage);
}
function onEnterFrame() {
gotoAndStop(Math.floor(mcMover._x));
}
function resetDamage(d) {
mcMover._x = 1;
gotoAndStop(1);
nStartDamage = d;
nDamage = d;
}
}
Symbol 444 MovieClip [__Packages.com.digitaloutlook.sos.Boat] Frame 0
class com.digitaloutlook.sos.Boat extends MovieClip
{
var sState, pBoatStart, _x, _y, aHitBalls, mcHit, _visible, mcWhirlpool, nRotationSpeed, pCentrePoint, nBoatThrust, nRot, _rotation, pBoatSpeed, nTargetRot, nMiddleCount, _currentframe, nMiddleDamage, play, mcGameMain, _xscale, _yscale, mcExplosion;
function Boat () {
super();
}
function onLoad() {
configUI();
}
function configUI() {
sState = "wait";
pBoatStart = new flash.geom.Point();
pBoatStart.x = _x;
pBoatStart.y = _y;
aHitBalls = new Array();
var _local2 = 0;
while (_local2 < 9) {
aHitBalls.push(this["mcHit" + _local2]);
aHitBalls[_local2]._visible = false;
_local2++;
}
mcHit._alpha = 0;
_visible = false;
mcWhirlpool = _level0.mcWhirlpool;
nRotationSpeed = 1;
pCentrePoint = new flash.geom.Point(300, 200);
nBoatThrust = 4;
nRot = _rotation;
}
function onEnterFrame() {
switch (sState) {
case "wait" :
break;
case "sailing" :
var _local13 = nBoatThrust * Math.cos((PI / 180) * nRot);
var _local12 = nBoatThrust * Math.sin((PI / 180) * nRot);
pBoatSpeed = new flash.geom.Point(_local13, _local12);
var _local6 = new flash.geom.Point(_x, _y);
var _local14 = mcWhirlpool.getWhirlpoolForce(_local6, "boat");
var _local7 = pBoatSpeed.add(_local14);
var _local15 = nTargetRot;
nTargetRot = com.digitaloutlook.functions.MyMath.GetAngleFromPoints(_local7, new flash.geom.Point(0, 0));
if (Key.isDown(39)) {
nTargetRot = nTargetRot + 45;
} else if (Key.isDown(37)) {
nTargetRot = nTargetRot - 45;
}
var _local9 = com.digitaloutlook.functions.MyMath.GetDistanceBetweenPoints(pCentrePoint, _local6);
if (_local9 < 32) {
nMiddleCount++;
if (_currentframe == 1) {
if (nMiddleCount > 15) {
nMiddleDamage = 4;
nMiddleDamage = nMiddleDamage * 1.5;
}
play();
mcGameMain.boatInTheMiddle(nMiddleDamage);
}
} else {
nMiddleCount = 0;
nMiddleDamage = 1;
}
if (_local9 < SHRINKDISTANCE) {
var _local8 = 100 * (_local9 / SHRINKDISTANCE);
if (_local8 < 70) {
_local8 = 70;
}
_xscale = (_yscale = _local8);
}
if (Math.abs(_local15 - nTargetRot) > 180) {
if (nRot < 0) {
nTargetRot = nTargetRot - 360;
} else {
nTargetRot = nTargetRot + 360;
}
if (nTargetRot > 360) {
nTargetRot = nTargetRot - 360;
nRot = nRot - 360;
}
}
nRot = nRot + ((nTargetRot - nRot) * 0.3);
_rotation = nRot;
var _local5 = _x + _local7.x;
var _local4 = _y + _local7.y;
var _local11 = mcGameMain.checkBoatPos(_local5, _local4);
if (!_local11) {
_level0.FX.playSound(0, true, 100, false);
if (_x < 23) {
_local13 = 5;
_local12 = 0;
} else {
var _local10 = com.digitaloutlook.functions.MyMath.GetAngleFromPoints(pCentrePoint, _local6);
_local13 = 5 * Math.cos((PI / 180) * _local10);
_local12 = 5 * Math.sin((PI / 180) * _local10);
}
_local5 = _local5 + _local13;
_local4 = _local4 + _local12;
}
_x = _local5;
_y = _local4;
var _local2 = 0;
for(;;){
if (_local2 >= aHitBalls.length) {
break;
}
var _local3 = mcGameMain.mcKraken.hitTest(_x + aHitBalls[_local2]._x, _y + aHitBalls[_local2]._y, true);
if (_local3) {
if (_currentframe == 1) {
play();
mcGameMain.boatHitByKraken();
}
}
_local2++;
};
}
}
function pauzeGame() {
sState = "pauzed";
}
function resumeGame() {
_visible = true;
sState = "sailing";
}
function doExplosion(bombpos) {
var _local2 = new flash.geom.Point(_x, _y);
var _local3 = _local2.subtract(bombpos);
mcExplosion.play();
}
function restart() {
_xscale = (_yscale = 100);
sState = "wait";
nRot = 0;
_rotation = 0;
_x = pBoatStart.x;
_y = pBoatStart.y;
}
function setGameMain(_mstr) {
mcGameMain = _mstr;
}
function setAsail() {
if (sState != "pauzed") {
_xscale = (_yscale = 100);
nRot = 0;
_rotation = 0;
_visible = true;
sState = "sailing";
}
}
function getShootAngle() {
var _local2;
if ((_x > pCentrePoint.x) && (_y < pCentrePoint.y)) {
if (_rotation > 0) {
_local2 = -180;
} else {
_local2 = 0;
}
} else if ((_x > pCentrePoint.x) && (_y > pCentrePoint.y)) {
if (_rotation > 0) {
_local2 = -180;
} else {
_local2 = 0;
}
} else if ((_x < pCentrePoint.x) && (_y > pCentrePoint.y)) {
if (_rotation < 0) {
_local2 = -180;
} else {
_local2 = 0;
}
} else if (_rotation < 0) {
_local2 = -180;
} else {
_local2 = 0;
}
return(_rotation - _local2);
}
var SHRINKDISTANCE = 100;
var PI = Math.PI;
}
Symbol 16 MovieClip Frame 1
stop();
Symbol 97 MovieClip [barrelID] Frame 9
stop();
Symbol 97 MovieClip [barrelID] Frame 50
gotoAndPlay ("floating");
Symbol 103 MovieClip [cannonballID] Frame 1
stop();
Symbol 103 MovieClip [cannonballID] Frame 11
this.removeMovieClip();
Symbol 103 MovieClip [cannonballID] Frame 20
this.removeMovieClip();
Symbol 107 MovieClip Frame 1
if (firstrun == undefined) {
this.gotoAndPlay(Math.floor(Math.random() * 80));
firstrun = true;
}
Symbol 122 MovieClip [soulID] Frame 9
stop();
Symbol 122 MovieClip [soulID] Frame 45
gotoAndPlay ("floating");
Symbol 125 MovieClip [explosionID] Frame 1
stop();
Symbol 125 MovieClip [explosionID] Frame 2
this._parent.gotoAndStop(2);
this.onEnterFrame = function () {
if (_level0.mcGame.bIsPauzed) {
stop();
} else {
play();
}
};
Symbol 125 MovieClip [explosionID] Frame 14
_level0.mcGame.mineGone();
delete this.onEnterFrame;
this._parent._parent.removeMovieClip();
Symbol 126 MovieClip Frame 1
stop();
Symbol 127 MovieClip [mineID] Frame 9
stop();
Symbol 127 MovieClip [mineID] Frame 85
gotoAndPlay ("floating");
Symbol 173 MovieClip Frame 16
if (this.goSlap) {
r = Math.floor(Math.random() * 3);
gotoAndPlay("slap" + r);
} else {
gotoAndPlay ("loop");
}
Symbol 173 MovieClip Frame 54
_level0.FX.playSound(9);
Symbol 173 MovieClip Frame 69
this.goSlap = false;
this.gotoAndPlay("loop");
Symbol 173 MovieClip Frame 108
_level0.FX.playSound(9);
Symbol 173 MovieClip Frame 122
this.goSlap = false;
this.gotoAndPlay("loop");
Symbol 173 MovieClip Frame 161
_level0.FX.playSound(9);
Symbol 173 MovieClip Frame 174
this.goSlap = false;
this.gotoAndPlay("loop");
Symbol 175 MovieClip [krakenID] Frame 1
#initclip 15
Object.registerClass("krakenID", com.digitaloutlook.sos.Kraken);
#endinitclip
Symbol 175 MovieClip [krakenID] Frame 14
bStop = true;
krakenIsHere();
Symbol 175 MovieClip [krakenID] Frame 29
bStop = true;
removeKraken();
Symbol 175 MovieClip [krakenID] Frame 49
bStop = true;
startNewLevel();
Symbol 175 MovieClip [krakenID] Frame 68
bStop = true;
removeKraken();
Symbol 210 MovieClip [Whirlpool] Frame 1
#initclip 16
Object.registerClass("Whirlpool", com.digitaloutlook.sos.Whirlpool);
#endinitclip
Symbol 221 Button
on (release) {
_level0.FX.playSound(1);
_level0.play();
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 227 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("instructions");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 233 Button
on (release) {
gotoAndPlay ("fadeback");
}
Symbol 250 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("fadeback");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 251 Button
on (release) {
gotoAndPlay ("instructions");
}
Symbol 252 Button
on (release) {
_level0.FX.playSound(1);
_root.gotoAndPlay("play");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 253 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("instructions");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 254 MovieClip Frame 1
stop();
Symbol 254 MovieClip Frame 15
stop();
Symbol 266 MovieClip [Boat] Frame 1
#initclip 19
Object.registerClass("Boat", com.digitaloutlook.sos.Boat);
#endinitclip
stop();
Symbol 269 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 42
this._visible = false;
Symbol 276 MovieClip Frame 1
stop();
mcCountDownNumber.gotoAndStop(1);
Symbol 276 MovieClip Frame 2
this.onEnterFrame = function () {
if (_level0.mcGame.bIsPauzed) {
stop();
} else {
play();
}
};
mcCountDownNumber.gotoAndStop(1);
Symbol 276 MovieClip Frame 13
mcCountDownNumber.gotoAndStop(2);
Symbol 276 MovieClip Frame 26
mcCountDownNumber.gotoAndStop(3);
Symbol 276 MovieClip Frame 47
delete this.onEnterFrame;
this._parent.countdownDone();
Symbol 277 MovieClip [GAME] Frame 1
#initclip 17
Object.registerClass("GAME", com.digitaloutlook.sos.GameMain);
#endinitclip
Symbol 288 MovieClip Frame 1
stop();
Symbol 295 MovieClip Frame 12
stop();
Symbol 295 MovieClip Frame 24
stop();
Symbol 299 MovieClip [damage bar] Frame 1
#initclip 18
Object.registerClass("damage bar", com.digitaloutlook.gameElements.DamageIndicator);
#endinitclip
Symbol 302 MovieClip Frame 1
stop();
Symbol 307 Button
on (release) {
_root.instructions.play();
}
Symbol 315 Button
on (release) {
_level0.mcGame.pauzeGame();
_level0.FX.playSound(1);
_level0.FX.playSound(11);
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 318 MovieClip Frame 20
stop();
Symbol 318 MovieClip Frame 38
stop();
Symbol 339 Button
on (release) {
_level0.gotoAndPlay("gameplay");
}
Symbol 343 Button
on (release) {
_level0.FX.playSound(11);
_level0.FX.playSound(1);
_parent.play();
_level0.mcGame.restart();
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 344 Button
on (release) {
_level0.FX.playSound(11);
_level0.FX.playSound(1);
_level0.mcGame.resumeGame();
_parent.play();
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 346 MovieClip Frame 1
stop();
Symbol 346 MovieClip Frame 15
stop();
Symbol 347 Button
on (release) {
_level0.FX.playSound(1);
_level0.gotoAndPlay("gameplay");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 351 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("instructions");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 355 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("www");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 357 Button
on (release) {
gotoAndPlay ("instructions");
}
Symbol 358 Button
on (release) {
gotoAndPlay ("www");
}
Symbol 359 Button
on (release) {
gotoAndPlay ("fadeback");
}
Symbol 360 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("fadeback");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 361 Button
on (release) {
gotoAndPlay ("wwwfadeback");
}
Symbol 367 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("wwwfadeback");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 413 MovieClip Frame 12
stop();
var aLinks = new Array();
aLinks.push("http://www.potc.co.uk");
aLinks.push("http://www.pirates2-ledvd.com");
aLinks.push("http://www.pirates2.nl");
aLinks.push("http://www.piratidvd.it");
aLinks.push("http://www.fluch-der-karibik2.aufdvd.de");
aLinks.push("http://www.piratasdelcaribe2.es");
aLinks.push("http://www.pirates2.no");
aLinks.push("http://www.pirates2.dk");
aLinks.push("http://www.pirates2.se");
aLinks.push("http://www.pirates2.fi");
aLinks.push("http://www.everythingpirates.com.au");
aLinks.push("http://www.pirates2.be");
var i = 0;
while (i < aLinks.length) {
this["flag" + i].link = aLinks[i];
this["flag" + i].onRelease = function () {
getURL (this.link, "_blank");
if (this.link == "http://www.potc.co.uk") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_EN/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.pirates2-ledvd.com") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_FR/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.pirates2.nl") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_NL/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.piratidvd.it") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_IT/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.fluch-der-karibik2.aufdvd.de") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_DE/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.piratasdelcaribe2.es") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_ES/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.pirates2.no") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_NO/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.pirates2.dk") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_DK/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.pirates2.se") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_SWE/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.pirates2.fi") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_FI/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.everythingpirates.com.au") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_AUZ/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
} else if (this.link == "http://www.pirates2.be") {
var _local2 = "http://ads.miniclip.com/RealMedia/ads/adstream_sx.ads/miniclip.com/pirates_BE/142334@x01";
trace("Counter called: " + _local2);
this.loadVariables(_local2);
}
};
i++;
}
Symbol 414 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("www");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 415 MovieClip Frame 1
function getStringFromTime(n) {
var _local2 = Math.floor(n / 60);
var _local1 = Math.floor(n - (_local2 * 60));
if (_local1 < 10) {
timestring = (_local2 + ":0") + _local1;
} else {
timestring = (_local2 + ":") + _local1;
}
return(timestring);
}
stop();
this.mcCurrent.mcNumber.number_txt.text = getStringFromTime(_level0.nCurrentTime);
this.mcBest.mcNumber.number_txt.text = getStringFromTime(_level0.nBestTime);
Symbol 415 MovieClip Frame 15
stop();
Symbol 415 MovieClip Frame 27
this.gotoAndStop(1);
Symbol 415 MovieClip Frame 46
stop();
Symbol 415 MovieClip Frame 60
this.gotoAndStop(1);
Symbol 421 Button
on (release) {
_level0.FX.playSound(1);
_level0.gotoAndPlay("gameplay");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 422 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("instructions");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 423 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("www");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 424 Button
on (release) {
gotoAndPlay ("instructions");
}
Symbol 425 Button
on (release) {
gotoAndPlay ("www");
}
Symbol 426 Button
on (release) {
gotoAndPlay ("fadeback");
}
Symbol 427 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("fadeback");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 428 Button
on (release) {
gotoAndPlay ("wwwfadeback");
}
Symbol 429 Button
on (release) {
_level0.FX.playSound(1);
gotoAndPlay ("wwwfadeback");
}
on (rollOver) {
_level0.FX.playSound(2);
}
Symbol 430 MovieClip Frame 1
stop();
this.mcCurrent.mcNumber.number_txt.text = "" + _level0.nCurrentSoulsCount;
this.mcBest.mcNumber.number_txt.text = "" + _level0.nBestSoulsCount;
Symbol 430 MovieClip Frame 15
stop();
Symbol 430 MovieClip Frame 27
this.gotoAndStop(1);
Symbol 430 MovieClip Frame 47
stop();
Symbol 430 MovieClip Frame 61
this.gotoAndStop(1);