Frame 1
function onLaunchGame() {
_root.game = new midasplayer.goldfishbowl.Game(_root);
_root.game.init(_root.gda);
}
_root.gda = new com.midasplayer.util.GameDataAcquirer();
_root.gda.beginWait(mx.utils.Delegate.create(this, onLaunchGame));
Symbol 162 MovieClip [pick_housemate] Frame 1
#initclip 51
Object.registerClass("pick_housemate", midasplayer.goldfishbowl.HeadSelector);
#endinitclip
Symbol 183 MovieClip [keruben] Frame 1
#initclip 46
Object.registerClass("keruben", midasplayer.goldfishbowl.Fisherman);
#endinitclip
stop();
Symbol 205 MovieClip [expl] Frame 23
stop();
this.removeMovieClip();
Symbol 217 MovieClip [platta_levelover] Frame 1
#initclip 47
Object.registerClass("platta_levelover", midasplayer.goldfishbowl.LevelOverPlate);
#endinitclip
Symbol 231 MovieClip [treasure] Frame 1
stop();
Symbol 231 MovieClip [treasure] Frame 2
stop();
Symbol 242 MovieClip [sturgeon] Frame 1
stop();
Symbol 242 MovieClip [sturgeon] Frame 2
stop();
Symbol 252 MovieClip [platta_intro] Frame 1
#initclip 48
Object.registerClass("platta_intro", midasplayer.goldfishbowl.IntroPlate);
#endinitclip
Symbol 257 MovieClip [platta_gameover] Frame 1
#initclip 49
Object.registerClass("platta_gameover", midasplayer.goldfishbowl.GameOverPlate);
#endinitclip
Symbol 278 MovieClip Frame 1
stop();
Symbol 281 MovieClip [diamondfish] Frame 1
stop();
Symbol 281 MovieClip [diamondfish] Frame 2
stop();
Symbol 283 MovieClip [fish] Frame 1
stop();
Symbol 283 MovieClip [fish] Frame 2
stop();
Symbol 308 MovieClip [fish2] Frame 1
stop();
Symbol 308 MovieClip [fish2] Frame 2
stop();
Symbol 375 MovieClip [hook2] Frame 1
#initclip 50
Object.registerClass("hook2", midasplayer.goldfishbowl.Hook);
#endinitclip
stop();
Symbol 375 MovieClip [hook2] Frame 2
stop();
Instance of Symbol 377 MovieClip "exitbutton" in Symbol 380 MovieClip [exitbutton] Frame 1
on (press) {
_root.game.onExitButton();
}
Symbol 404 MovieClip Frame 1
stop();
Instance of Symbol 377 MovieClip "soundbutton" in Symbol 407 MovieClip Frame 1
on (press) {
_root.game.onToggleSoundButton();
}
Symbol 408 MovieClip [__Packages.com.midasplayer.util.I18n] Frame 0
class com.midasplayer.util.I18n
{
static var lang;
function I18n () {
}
static function init(newLang) {
lang = newLang;
}
static function getProperties() {
return(lang);
}
static function getString(name) {
var _local4 = lang.get(name);
var _local3;
if (_local4 == undefined) {
_local3 = ("{" + name) + "}";
} else {
_local3 = _local4.toString();
}
var _local2 = 1;
while (_local2 < arguments.length) {
_local3 = _local3.split(("{" + (_local2 - 1)) + "}").join(arguments[_local2]);
_local2++;
}
return(_local3);
}
}
Symbol 409 MovieClip [__Packages.com.midasplayer.util.Map] Frame 0
class com.midasplayer.util.Map
{
var map, lastSize;
function Map (init) {
map = new Object();
for (var _local3 in init) {
map["" + _local3] = init[_local3];
}
lastSize = -1;
}
function put(key, value) {
map["" + key] = value;
lastSize = -1;
}
function get(key) {
return(map["" + key]);
}
function remove(key) {
var _local2 = "" + key;
var _local3 = map[_local2];
delete map[_local2];
lastSize = -1;
return(_local3);
}
function contains(key) {
return(map["" + key] != undefined);
}
function count() {
if (lastSize < 0) {
lastSize = 0;
for (var _local2 in map) {
lastSize++;
}
}
return(lastSize);
}
function size() {
return(count());
}
function clear() {
map = {};
lastSize = 0;
}
function dump() {
var _local2 = "";
for (var _local3 in map) {
_local2 = _local2 + (((_local3 + "=>") + map[_local3]) + newline);
}
}
function toArray() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = map[_local3];
}
return(_local2);
}
function keySet() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = _local3;
}
return(_local2);
}
function get iterator() {
return(new com.midasplayer.util.MapIterator(this));
}
function get valueIterator() {
return(new com.midasplayer.util.MapValueIterator(this));
}
function foreach(fn) {
var _local3 = arguments.slice(1);
if (_local3.length > 0) {
do {
if ((in map) == null) {
break;
}
var _local5 = in map;
} while (fn(_local5, map[_local5], _local3[0], _local3[1], _local3[2], _local3[3], _local3[4]) != false);
do {
} while ("foreach" != null);
} else {
do {
if ((in map) == null) {
break;
}
var _local5 = in map;
} while (fn(_local5, map[_local5]) != false);
do {
} while (_local2 != null);
}
lastSize = -1;
}
function get _content() {
return(map);
}
}
Symbol 410 MovieClip [__Packages.com.midasplayer.util.Iterator] Frame 0
interface com.midasplayer.util.Iterator
{
}
Symbol 411 MovieClip [__Packages.com.midasplayer.util.MapIterator] Frame 0
class com.midasplayer.util.MapIterator implements com.midasplayer.util.Iterator
{
var map, keys, ptr;
function MapIterator (map) {
this.map = map;
keys = map.keySet();
ptr = 0;
}
function next() {
if (ptr < keys.length) {
return(keys[ptr++]);
}
return(undefined);
}
function hasNext() {
return(ptr != keys.length);
}
function remove() {
if (ptr == 0) {
return(undefined);
}
map.remove(keys[ptr - 1]);
}
}
Symbol 412 MovieClip [__Packages.com.midasplayer.util.MapValueIterator] Frame 0
class com.midasplayer.util.MapValueIterator implements com.midasplayer.util.Iterator
{
var map, mapRef, keys, ptr;
function MapValueIterator (map) {
this.map = map;
mapRef = map._content;
keys = map.keySet();
ptr = 0;
}
function next() {
return(mapRef[keys[ptr++]]);
}
function hasNext() {
return(ptr != keys.length);
}
function remove() {
if (ptr == 0) {
return(undefined);
}
map.remove(keys[ptr - 1]);
}
}
Symbol 413 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 414 MovieClip [__Packages.midasplayer.goldfishbowl.IObjectManager] Frame 0
interface midasplayer.goldfishbowl.IObjectManager
{
}
Symbol 415 MovieClip [__Packages.com.midasplayer.util.Sprite] Frame 0
class com.midasplayer.util.Sprite
{
var sxp, syp, mc, animator, alpha, r, fx, fy, fr, immedate, hooks, opacity, scale, color, lastResource, thisParent, visible, currentColor, posX, posY, frame, signalValue, realWidth, realHeight;
function Sprite (resource, ix, iy, iframe, parent) {
sxp = 0;
syp = 0;
mc = null;
animator = null;
alpha = 100;
r = 0;
fx = new com.midasplayer.timing.IFloat();
fy = new com.midasplayer.timing.IFloat();
fr = new com.midasplayer.timing.IFloat();
immedate = true;
hooks = new com.midasplayer.util.Map();
opacity = new Object();
scale = new Object();
color = new Object();
lastResource = resource;
thisParent = ((parent == undefined) ? _root : (parent));
visible = false;
currentColor = {ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:0, ab:0};
if ((((ix != undefined) && (iy != undefined)) && (iframe != undefined)) && (resource != undefined)) {
visible = true;
}
posX = ix;
posY = iy;
frame = iframe;
if (resource != undefined) {
bind();
}
}
function setAttribute(name, value) {
if (mc != undefined) {
mc.properties[name] = value;
}
}
function getAttribute(name) {
if (mc != undefined) {
return(mc.properties[name]);
}
}
function get signal() {
return(signalValue);
}
function set signal(value) {
signalValue = value;
//return(signal);
}
function setFrame(f) {
frame = f;
mc.gotoAndStop(frame + 1);
}
function getFrame() {
return(frame);
}
function setPosition(x, y) {
posX = x;
posY = y;
fx.set(x);
fy.set(y);
fr.set(r);
if (immedate && (mc != undefined)) {
mc._x = x;
mc._y = y;
}
}
function getPosition() {
return({x:posX, y:posY});
}
function setPosX(x) {
posX = x;
fx.set(x);
if (immedate && (mc != undefined)) {
mc._x = x;
}
}
function setPosY(y) {
posX = y;
fy.set(y);
if (immedate && (mc != undefined)) {
mc._y = y;
}
}
function setRotation(degree) {
r = degree;
if (mc != undefined) {
mc._rotation = degree;
}
}
function getRotation() {
return(r);
}
function getPosX() {
return(posX);
}
function getPosY() {
return(posY);
}
function getWidth() {
return(realWidth);
}
function getHeight() {
return(realHeight);
}
function getMovieClip() {
return(mc);
}
function setImmedateRendering(enable) {
immedate = enable;
fx.set(posX);
fy.set(posY);
}
function setDepth(depth) {
if (mc != undefined) {
mc.swapDepths(depth);
}
}
function setVisible(visible) {
this.visible = visible;
if (mc != undefined) {
mc._visible = visible;
}
}
function setScale(value) {
if (mc != undefined) {
mc._xscale = value;
mc._yscale = value;
}
}
function setAlpha(value) {
alpha = (mc._alpha = value);
}
function setParent(aParent) {
var _local2 = thisParent;
thisParent = aParent;
if (mc != undefined) {
destroy();
bind(lastResource);
posX = (mc._x = 0);
posY = (mc._y = 0);
}
}
function scaleFitInside(maxWidth, maxHeight) {
var _local9 = realWidth;
var _local8 = realHeight;
var _local2 = _local9;
var _local3 = _local8;
if ((_local2 < maxWidth) && (_local3 < maxWidth)) {
_local3 = _local3 * (maxWidth / _local2);
_local2 = maxWidth;
}
if (_local2 > maxWidth) {
_local3 = _local3 * (maxWidth / _local2);
_local2 = maxWidth;
}
if (_local3 > maxHeight) {
_local2 = _local2 * (maxHeight / _local3);
_local3 = maxHeight;
}
var _local7 = 100 * (1 - ((realWidth - _local2) / realWidth));
var _local5 = 100 * (1 - ((realHeight - _local3) / realHeight));
mc._xscale = _local7;
mc._yscale = _local5;
}
function updatePosition(alpha) {
if (immedate) {
return(undefined);
}
mc._x = fx.get(alpha);
mc._y = fy.get(alpha);
}
function setColorTransform(a) {
var _local2 = new Color(mc);
_local2.setTransform(a);
currentColor = a;
}
function setTint(r, g, b, amount) {
currentColor = new Object();
currentColor.ra = (currentColor.ga = (currentColor.ba = 100 - amount));
var _local2 = amount / 100;
currentColor.rb = r * _local2;
currentColor.gb = g * _local2;
currentColor.bb = b * _local2;
var _local3 = new Color(mc);
_local3.setTransform(currentColor);
}
function moveSpringy(centerx, centery, inertia, k) {
var _local3 = (-posX) + centerx;
var _local2 = (-posY) + centery;
sxp = (sxp * inertia) + (_local3 * k);
syp = (syp * inertia) + (_local2 * k);
setPosition(posX + sxp, posY + syp);
}
function delayedInvokation(duration, callback) {
var _local2 = new Object();
_local2.callback = callback;
_local2.finished = getTimer() + duration;
_local2.name = "delay-" + getUniqeId();
_local2.fn = function (owner, hook) {
return(hook.finished > getTimer());
};
hooks.put(_local2.name, _local2);
}
function approachColor(colorTransform, duration, callback) {
color.endTransform = colorTransform;
color.transformDiff = {ra:colorTransform.ra - currentColor.ra, rb:colorTransform.rb - currentColor.rb, ga:colorTransform.ga - currentColor.ga, gb:colorTransform.gb - currentColor.gb, ba:colorTransform.ba - currentColor.ba, bb:colorTransform.bb - currentColor.bb, aa:colorTransform.aa - currentColor.aa, ab:colorTransform.ab - currentColor.ab};
color.colorObj = new Color(mc);
color.duration = duration;
color.finishAt = duration + getTimer();
var _local4 = new Object();
_local4.callback = callback;
_local4.name = "color-";
_local4.fn = function (owner) {
var _local1 = owner.color;
var _local5 = _local1.finishAt - getTimer();
var _local6 = owner.mc;
if (_local5 <= 0) {
owner.currentColor = _local1.endTransform;
_local1.colorObj.setTransform(_local1.endTransform);
_local1.color = new Object();
return(false);
}
var _local4 = 1 - (_local5 / duration);
var _local3 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_local3.rb = owner.currentColor.rb + Math.floor(_local1.transformDiff.rb * _local4);
_local3.gb = owner.currentColor.gb + Math.floor(_local1.transformDiff.gb * _local4);
_local3.bb = owner.currentColor.bb + Math.floor(_local1.transformDiff.bb * _local4);
_local1.colorObj.setTransform(_local3);
return(true);
};
hooks.put(_local4.name, _local4);
}
function approachScale(targetScaleFactor, duration, keepCenter, callback) {
var _local6 = Math.max(mc._xscale, mc._yscale) - targetScaleFactor;
if (0 == Math.round(_local6)) {
if (callback) {
callback(this);
}
return(undefined);
}
scale.targetScale = targetScaleFactor;
scale.duration = duration;
scale.diff = _local6;
scale.finishAt = duration + getTimer();
scale.cx = mc._x + (mc._width / 2);
scale.cy = mc._y + (mc._height / 2);
var _local4 = new Object();
_local4.callback = callback;
_local4.name = "scale-";
_local4.fn = function (owner) {
var _local2 = owner.scale;
var _local5 = _local2.finishAt - getTimer();
var _local1 = owner.mc;
if (_local5 <= 0) {
owner.scale = new Object();
owner.mc._xscale = _local2.targetScale;
owner.mc._yscale = _local2.targetScale;
if (keepCenter) {
owner.posX = (_local1._x = _local2.cx - (_local1._width / 2));
owner.posY = (_local1._y = _local2.cy - (_local1._height / 2));
}
return(false);
}
var _local6 = _local5 / duration;
var _local4 = Math.round((_local6 * _local2.diff) + _local2.targetScale);
_local1._xscale = _local4;
_local1._yscale = _local4;
if (keepCenter) {
owner.posX = (_local1._x = _local2.cx - (_local1._width / 2));
owner.posY = (_local1._y = _local2.cy - (_local1._height / 2));
}
return(true);
};
hooks.put(_local4.name, _local4);
}
function approachAlpha(targetOpacity, duration, callback) {
if ((targetOpacity < 0) || (targetOpacity > 100)) {
mc._alpha = 100;
return(undefined);
}
opacity.targetOp = targetOpacity;
opacity.duration = duration;
opacity.diff = mc._alpha - targetOpacity;
opacity.finsishAt = duration + getTimer();
var _local3 = new Object();
_local3.callback = callback;
_local3.name = "alpha-";
_local3.fn = function (owner) {
var _local1 = owner.opacity;
var _local3 = _local1.finsishAt - getTimer();
if (_local3 <= 0) {
_local1.alpha = (owner.mc._alpha = _local1.targetOp);
owner.opacity = new Object();
return(false);
}
_local1.alpha = (owner.mc._alpha = Math.round(((_local3 / duration) * _local1.diff) + _local1.targetOp));
return(true);
};
hooks.put(_local3.name, _local3);
}
function applyAnimator(an, callback) {
animator = an;
animator.setSource(mc);
var _local2 = new Object();
_local2.callback = callback;
_local2.name = "anim-";
_local2.fn = function (owner) {
var _local1 = owner.animator;
if ((_local1 != undefined) && (!_local1.isFinished())) {
_local1.update();
return(true);
}
return(false);
};
hooks.put(_local2.name, _local2);
}
function bind(resource) {
if (resource == undefined) {
if (lastResource == undefined) {
return(undefined);
}
resource = lastResource;
}
var _local5 = thisParent.getNextHighestDepth();
var _local8 = "@sprite" + com.midasplayer.util.Numbers.itoa(_local5, 4);
mc = thisParent.attachMovie(resource, _local8, _local5);
mc._x = posX;
mc._y = posY;
realWidth = mc._width;
realHeight = mc._height;
mc._visible = visible;
mc._alpha = alpha;
mc.gotoAndStop(frame + 1);
var _local4 = new Object();
_local4.owner = this;
mc.properties = _local4;
lastResource = resource;
mc.onEnterFrame = function () {
var o = this.properties.owner;
var _local2 = o.hooks;
var _local4 = 0;
_local4 = _local2.count();
if (_local4 > 0) {
var list = new Array();
_local2.foreach(function (name, hook) {
if (hook.fn(o, hook) == false) {
if (hook.callback != undefined) {
hook.callback(o);
}
list.push(hook.name);
}
return(true);
});
for (var _local3 in list) {
_local2.remove(list[_local3]);
}
}
};
}
function flipX() {
if (mc != undefined) {
}
mc._yscale = -mc._yscale;
}
function flipY() {
if (mc != undefined) {
}
mc._xscale = -mc._xscale;
}
function destroy() {
if (mc != undefined) {
for (var _local2 in mc) {
if (_local2.indexOf("@sprite") == 0) {
mc[_local2].destroy();
}
}
for (var _local2 in mc.properties) {
delete mc.properties[_local2];
mc.properties[_local2] = null;
}
mc.onEnterFrame = undefined;
mc.swapDepths(1048000);
mc.removeMovieClip();
mc = undefined;
}
hooks.clear();
}
function clearHooks() {
hooks.clear();
}
function hookCount() {
return(hooks.count());
}
function getUniqeId() {
var _local1 = (Math.random() * 10000) >> 0;
var _local2 = getTimer();
return((_local1 + ":") + _local2);
}
}
Symbol 416 MovieClip [__Packages.com.midasplayer.util.Animator] Frame 0
class com.midasplayer.util.Animator
{
var finished, targetObject, x, startX, y, startY, startTime, tick, duration, timeTicks, targetY, targetX, dx, dy, dt, callback, callbackFire;
function Animator (t) {
finished = true;
targetObject = t;
x = (startX = t._x);
y = (startY = t._y);
startTime = null;
tick = 0;
duration = 800;
timeTicks = false;
}
function fillBaseCopy(t, o) {
o.targetObject = t;
o.duration = duration;
o.x = x;
o.y = y;
o.startTime = startTime;
o.finished = finished;
o.timeTicks = timeTicks;
o.tick = tick;
o.targetY = targetY;
o.targetX = targetX;
o.startX = startX;
o.startY = startY;
o.dx = dx;
o.dy = dy;
o.dt = dt;
}
function setSource(t) {
targetObject = t;
x = (startX = t._x);
y = (startY = t._y);
}
function complete() {
startTime = null;
x = targetX;
y = targetY;
finished = true;
targetObject._x = x;
targetObject._y = y;
}
function setPosition(x, y) {
startX = targetObject._x;
startY = targetObject._y;
targetX = Math.round(x);
targetY = Math.round(y);
finished = false;
startTime = null;
}
function setDuration(ms) {
duration = ms;
finished = false;
startTime = null;
}
function setDurationTicks(ticks) {
duration = ticks;
finished = false;
startTime = null;
timeTicks = true;
}
function getElapsedPercent() {
return(getElapsed());
}
function getElapsed() {
if ((!dt) || (duration == 0)) {
return(1);
}
return(Math.max(0, duration - dt) / duration);
}
function update() {
if (finished) {
if (callback && ((1 - getElapsed()) >= callbackFire)) {
callback();
callbackFire = undefined;
callback = undefined;
}
return(true);
}
if (!timeTicks) {
var _local2 = getTimer();
if (startTime == null) {
startTime = _local2;
}
dt = _local2 - startTime;
} else {
dt = tick;
tick++;
}
dx = targetX - startX;
dy = targetY - startY;
nextPosition();
var _local4 = false;
x = Math.floor(x);
if (((x >= targetX) && (targetX >= startX)) || ((x <= targetX) && (targetX <= startX))) {
_local4 = true;
x = targetX;
}
var _local3 = false;
y = Math.floor(y);
if (((y >= targetY) && (targetY >= startY)) || ((y <= targetY) && (targetY <= startY))) {
_local3 = true;
y = targetY;
}
if (_local4 && (_local3)) {
startTime = null;
x = targetX;
y = targetY;
finished = true;
}
targetObject._x = x;
targetObject._y = y;
if (callback && ((1 - getElapsed()) >= callbackFire)) {
callback();
callbackFire = undefined;
callback = undefined;
}
return(finished);
}
function setCallback(at, fn) {
callbackFire = ((at == undefined) ? 1 : (at));
callback = fn;
}
function toString() {
return((((((((("Animator[start=" + [startX, startY]) + ", target=") + [targetX, targetY]) + ", t=") + getElapsedPercent()) + ", ticks=") + tick) + ", targetObject=") + [targetObject._x, targetObject._y]);
}
function isFinished() {
return(finished);
}
function nextPosition() {
}
}
Symbol 417 MovieClip [__Packages.com.midasplayer.timing.IFloat] Frame 0
class com.midasplayer.timing.IFloat
{
static var alpha;
var ivalue, lastValue;
function IFloat (initial) {
ivalue = initial;
lastValue = initial;
alpha = 0;
}
function setTo(initial) {
ivalue = initial;
lastValue = initial;
}
function set(newValue) {
lastValue = ivalue;
ivalue = newValue;
}
function get(lalpha) {
return(lastValue + ((ivalue - lastValue) * lalpha));
}
static function setAlpha(na) {
alpha = na;
}
function get value() {
return(lastValue + ((ivalue - lastValue) * alpha));
}
function set value(v) {
ivalue = v;
lastValue = v;
//return(value);
}
}
Symbol 418 MovieClip [__Packages.com.midasplayer.util.Numbers] Frame 0
class com.midasplayer.util.Numbers
{
function Numbers () {
}
static function dec2hex(iValue, padding) {
var _local1 = "";
while (iValue != 0) {
_local1 = "0123456789abcdef".charAt(iValue & 15) + _local1;
iValue = iValue >>> 4;
}
if (padding) {
if (_local1.length == 0) {
_local1 = "00";
}
if (_local1.length < 2) {
_local1 = "0" + _local1;
}
} else if (_local1.length == 0) {
_local1 = "0";
}
return(_local1);
}
static function itoa(value, numZeroPadding) {
var _local2 = "" + value;
if (numZeroPadding) {
var _local1 = numZeroPadding - 1;
while (_local1 > 0) {
if (value < Math.pow(10, _local1)) {
_local2 = "0" + _local2;
}
_local1--;
}
}
return(_local2);
}
static function asTime(millis, alwaysHours, alwaysMinutes) {
if (alwaysHours) {
alwaysMinutes = true;
}
if (millis < 0) {
millis = 0;
}
millis = millis / 1000;
millis = Math.floor(millis);
var _local3 = Math.floor(millis / 3600);
var _local4 = Math.floor(millis / 60) % 60;
var _local5 = millis % 60;
var _local1 = "";
if (alwaysHours || (_local3 > 0)) {
_local1 = _local1 + itoa(_local3, 2);
}
if (alwaysHours || (_local1.length > 0)) {
_local1 = _local1 + ":";
}
var _local6 = _local1.length;
if ((alwaysMinutes || (_local4 > 0)) || (_local3 > 0)) {
_local1 = _local1 + itoa(_local4, 2);
}
if (alwaysMinutes || (_local1.length != _local6)) {
_local1 = _local1 + ":";
}
return(_local1 + itoa(_local5, 2));
}
}
Symbol 419 MovieClip [__Packages.midasplayer.goldfishbowl.TankItem] Frame 0
class midasplayer.goldfishbowl.TankItem extends com.midasplayer.util.Sprite
{
var objMgr, name, exploded, startX, startY, flipState, id, fl, fm, tickCount, realWidth, realHeight, tankLeft, tankTop, tankRight, tankBottom, isCaught, setPosition, mc, r, flipX, uid, getPosX, getPosY, applyAnimator, approachScale, approachAlpha, moveSpringy;
function TankItem (mgr, name, x, y, p) {
super(name, x, y, 0, p);
var _local5 = mgr;
objMgr = _local5;
if (ITEM[name] == undefined) {
this.name = "none";
} else {
this.name = name;
}
exploded = false;
startX = x;
startY = y;
flipState = false;
id = ++idCounter;
fl = (Math.random() * 2) * Math.PI;
fm = (Math.random() - 0.5) / 5;
tickCount = 0;
var _local3 = 0;
while (_local3 < ITEMLIST.length) {
if (ITEMLIST[_local3] == name) {
realWidth = SIZE[_local3][0];
realHeight = SIZE[_local3][1];
return;
}
_local3++;
}
}
function onCatch() {
return(true);
}
function setTankLimits(left, top, right, bottom) {
tankLeft = left;
tankTop = top;
tankRight = right;
tankBottom = bottom;
}
function setCaught(c) {
isCaught = c;
}
function getWidth() {
return(realWidth);
}
function getHeight() {
return(realHeight);
}
function setItemPosition(x, y) {
setPosition(x, y);
var _local2 = mc.properties.bounds;
_local2.setPosition(x, y, r * DEGREE_TO_RADIAN);
}
function getArea() {
return(mc.properties.bounds.getArea());
}
function getBoundBox() {
return(mc.properties.bounds);
}
function flip() {
flipState = !flipState;
r = (r + 180) % 360;
flipX();
setRotation(r);
}
function setRotation(r) {
super.setRotation(r);
}
function getRotation() {
return(r);
}
function getWeight() {
return(ITEM[name].weight);
}
function set uniqeId(id) {
uid = id;
//return(uniqeId);
}
function get uniqeId() {
return(uid);
}
function getPoints() {
return(ITEM[name].points);
}
function getName() {
return(name);
}
function onBlast() {
return(true);
}
function onAcquire(lastAngle) {
var _local5 = DEGREE_TO_RADIAN * lastAngle;
var _local6 = com.midasplayer.util.SineLookup.__get__instance();
var _local4 = _local6.sin(_local5) * 100;
var _local3 = _local6.cos(_local5) * 100;
var _local2 = new com.midasplayer.util.EaseInQuadAnimator();
_local2.setPosition(getPosX() + _local4, getPosY() + _local3);
_local2.setDuration(500);
applyAnimator(_local2);
approachScale(500, 500);
approachAlpha(0, 520, function (s) {
s.destroy();
});
_local2 = new com.midasplayer.util.EaseInQuadAnimator();
_local2.setPosition((getPosX() + _local4) + 15, (getPosY() + _local3) + 15);
_local2.setDuration(500);
}
function updateCaught(hookX, hookY, hookAngle) {
moveSpringy(hookX, hookY, 0.65, 0.35);
setRotation(hookAngle);
}
function get tick() {
return(tickCount);
}
function update() {
tickCount++;
}
static var ITEM = {fish:{weight:65, points:25, dx:20, dy:20, yoffs:-30}, fish2:{weight:70, points:50, dx:20, dy:20, yoffs:-22}, bra:{weight:20, points:75, dx:50, dy:50, yoffs:-10}, crisps:{weight:30, points:100, dx:40, dy:30}, briefs:{weight:20, points:25, dx:20, dy:20, yoffs:-25}, caviar:{weight:10, points:1000, dx:10, dy:10}, cell:{weight:5, points:300, dx:10, dy:10, yoffs:-30}, cola:{weight:5, points:300, dx:10, dy:10}, mine:{weight:100, points:0, dx:40, dy:40}, korv:{weight:5, points:250, dx:20, dy:10, yoffs:-17}, champagne:{weight:5, points:400, dx:10, dy:10}, toffee:{weight:10, points:400, dx:10, dy:10}, tire:{weight:85, points:10, dx:50, dy:20, yoffs:-25}, smalltire:{weight:60, points:10, dx:30, dy:30}, sturgeon:{weight:5, points:0, dx:0, dy:0, yoffs:-90}, diamondfish:{weight:65, points:500, dx:20, dy:20, yoffs:-18}, treasure:{weight:50, points:0, dx:40, dy:0, yoffs:-30}, sunlotion:{weight:10, points:500, dx:10, dy:10}, beans:{weight:10, points:200, dx:10, dy:10}, none:{weight:10, points:0, dx:10, dy:10}};
static var SIZE = [[100, 30], [51, 65], [53, 26], [50, 21], [66, 60], [25, 25], [13.35, 36.45], [31, 69], [74, 65], [22, 50], [28, 41], [50.4, 27.7], [44, 100], [35, 79], [194, 43], [100, 30], [68, 80], [25, 60], [38, 50]];
static var ITEMLIST = ["fish", "fish2", "bra", "crisps", "briefs", "caviar", "cell", "cola", "mine", "korv", "champagne", "toffee", "tire", "smalltire", "sturgeon", "diamondfish", "treasure", "sunlotion", "beans"];
static var DEGREE_TO_RADIAN = 0.0174532925;
static var idCounter = 0;
}
Symbol 420 MovieClip [__Packages.midasplayer.goldfishbowl.BoundBox] Frame 0
class midasplayer.goldfishbowl.BoundBox
{
var r, x, y, w, h, lrs, lrc, intersects, line, px, py, maxRadius, cx, cy;
function BoundBox (x, y, w, h, angle) {
r = angle;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
var _local5 = com.midasplayer.util.SineLookup.__get__instance();
lrs = _local5.sin(r);
lrc = _local5.cos(r);
intersects = new Array();
line = new Array(4);
px = new Array(4);
py = new Array(4);
updateVert();
maxRadius = 0;
var _local2 = 0;
while (_local2 < 4) {
var _local4 = px[_local2] - cx;
_local4 = _local4 * _local4;
var _local3 = py[_local2] - cy;
_local3 = _local3 * _local3;
maxRadius = Math.max(maxRadius, Math.sqrt(_local4 + _local3));
_local2++;
}
}
function getArea() {
return(w * h);
}
function toString() {
return(("[BoundBox:" + [x, y, w, h, r]) + "]");
}
function updateVert() {
var _local6 = w / 2;
var _local5 = h / 2;
px[0] = x - _local6;
py[0] = y - _local5;
px[1] = x + _local6;
py[1] = y - _local5;
px[2] = x + _local6;
py[2] = y + _local5;
px[3] = x - _local6;
py[3] = y + _local5;
cx = x;
cy = y;
var _local2 = 0;
while (_local2 < 4) {
px[_local2] = px[_local2] - cx;
py[_local2] = py[_local2] - cy;
var _local4 = (lrc * px[_local2]) + (lrs * py[_local2]);
var _local3 = (lrs * px[_local2]) - (lrc * py[_local2]);
px[_local2] = _local4 + cx;
py[_local2] = _local3 + cy;
_local2++;
}
line[0] = new midasplayer.goldfishbowl.Line(px[0], py[0], px[1], py[1]);
line[1] = new midasplayer.goldfishbowl.Line(px[1], py[1], px[2], py[2]);
line[2] = new midasplayer.goldfishbowl.Line(px[2], py[2], px[3], py[3]);
line[3] = new midasplayer.goldfishbowl.Line(px[3], py[3], px[0], py[0]);
}
function setPoints(p) {
px[0] = p[0];
py[0] = p[1];
px[1] = p[2];
py[1] = p[3];
px[2] = p[4];
py[2] = p[5];
px[3] = p[6];
py[3] = p[7];
}
function getPoint(p) {
return([px[p], py[p]]);
}
function getLine(n) {
return(line[n]);
}
function mayCollide(other) {
var _local3 = other.getCenterX() - cx;
_local3 = _local3 * _local3;
var _local2 = other.getCenterY() - cy;
_local2 = _local2 * _local2;
var _local4 = other.getRadius() + maxRadius;
_local4 = _local4 * _local4;
return((_local3 + _local2) <= _local4);
}
function getPositionKey() {
return(Math.round(Math.sqrt((cx * cx) + (cy * cy))) / 960);
}
function getWidth() {
return(w);
}
function getHeight() {
return(h);
}
function getCenterX() {
return(cx);
}
function getRotation() {
return(r);
}
function getCenterY() {
return(cy);
}
function getRadius() {
return(maxRadius);
}
function setPosition(x, y, r) {
this.x = x;
this.y = y;
this.r = r;
var _local2 = com.midasplayer.util.SineLookup.__get__instance();
lrs = _local2.sin(r);
lrc = _local2.cos(r);
updateVert();
}
function intersectsWith(aBox) {
intersects = new Array();
var _local19 = false;
var _local17 = 0;
while (_local17 < 4) {
var _local16 = aBox.getLine(_local17);
var _local3 = _local16.x1;
var _local2 = _local16.y1;
var _local10 = _local16.x2;
var _local9 = _local16.y2;
var _local11 = 0;
while (_local11 < 4) {
var _local7 = getLine(_local11);
var _local5 = _local7.x1;
var _local13 = _local7.x2;
var _local6 = _local7.y1;
var _local12 = _local7.y2;
var _local8 = (((_local13 - _local5) * (_local2 - _local6)) - ((_local12 - _local6) * (_local3 - _local5))) / (((_local12 - _local6) * (_local10 - _local3)) - ((_local13 - _local5) * (_local9 - _local2)));
var _local15 = (((_local10 - _local3) * (_local2 - _local6)) - ((_local9 - _local2) * (_local3 - _local5))) / (((_local12 - _local6) * (_local10 - _local3)) - ((_local13 - _local5) * (_local9 - _local2)));
if (((_local8 > 0) && (_local8 < 1)) && ((_local15 > 0) && (_local15 < 1))) {
var _local4 = [0, 0];
_local4[0] = _local3 + (_local8 * (_local10 - _local3));
_local4[1] = _local2 + (_local8 * (_local9 - _local2));
_local19 = true;
intersects.push({x:_local4[0], y:_local4[1], s:(_local4[0] * 10000) + (_local4[1] * 100)});
}
_local11++;
}
_local17++;
}
_local17 = 0;
while (_local17 < 4) {
var _local14 = aBox.getPoint(_local17);
if (isInside(_local14[0], _local14[1])) {
intersects.push({x:_local14[0], y:_local14[1], s:(_local14[0] * 10000) + (_local14[1] * 100)});
}
_local17++;
}
_local17 = 0;
while (_local17 < 4) {
var _local14 = getPoint(_local17);
if (aBox.isInside(_local14[0], _local14[1])) {
intersects.push({x:_local14[0], y:_local14[1], s:(_local14[0] * 10000) + (_local14[1] * 100)});
}
_local17++;
}
return(_local19);
}
function isInside(x, y) {
var _local6 = px.length;
var _local2;
var _local3;
var _local5 = false;
_local2 = 0;
_local3 = _local6 - 1;
while (_local2 < _local6) {
if ((((py[_local2] <= y) && (y < py[_local3])) || ((py[_local3] <= y) && (y < py[_local2]))) && (x < ((((px[_local3] - px[_local2]) * (y - py[_local2])) / (py[_local3] - py[_local2])) + px[_local2]))) {
_local5 = !_local5;
}
_local3 = _local2++;
}
return(_local5);
}
function getOverlapArea() {
var _local8 = intersects.length;
if (_local8 == 0) {
return(0);
}
var _local2 = new Array(_local8);
var _local4 = 0;
while (_local4 < _local8) {
_local2[_local4] = intersects[_local4];
_local4++;
}
_local4 = 0;
while (_local4 < _local2.length) {
var _local7 = 0;
while (_local7 < _local2.length) {
if (_local2[_local4].s > _local2[_local7].s) {
var _local3 = _local2[_local4];
_local2[_local4] = _local2[_local7];
_local2[_local7] = _local3;
}
_local7++;
}
_local4++;
}
var _local5 = new Array(_local8 + 4);
var _local9 = computeChainHull(_local2, _local2.length, _local5);
_local5[_local9] = _local5[0];
_local5[_local9 + 1] = _local5[1];
var _local10 = 0;
_local4 = 1;
var _local7 = 2;
var _local6 = 0;
while (_local4 <= _local9) {
_local10 = _local10 + (_local5[_local4].x * (_local5[_local7].y - _local5[_local6].y));
_local4++;
_local7++;
_local6++;
}
return(Math.floor(_local10 / 2));
}
function isLeft(P0, P1, P2) {
return(((P1.x - P0.x) * (P2.y - P0.y)) - ((P2.x - P0.x) * (P1.y - P0.y)));
}
function computeChainHull(P, n, H) {
var _local8 = 0;
var _local3 = -1;
var _local2;
var _local10 = 0;
var _local6;
var _local13 = P[0].x;
_local2 = 1;
while (_local2 < n) {
if (P[_local2].x != _local13) {
break;
}
_local2++;
}
_local6 = _local2 - 1;
if (_local6 == (n - 1)) {
_local3++;
H[_local3] = P[_local10];
if (P[_local6].y != P[_local10].y) {
_local3++;
H[_local3] = P[_local6];
}
_local3++;
H[_local3] = P[_local10];
return(_local3 + 1);
}
var _local7;
var _local11 = n - 1;
var _local12 = P[n - 1].x;
_local2 = n - 2;
while (_local2 >= 0) {
if (P[_local2].x != _local12) {
break;
}
_local2--;
}
_local7 = _local2 + 1;
_local3++;
H[_local3] = P[_local10];
_local2 = _local6;
while (_local2++ , _local2 <= _local7) {
if ((isLeft(P[_local10], P[_local7], P[_local2]) >= 0) && (_local2 < _local7)) {
continue;
}
while (_local3 > 0) {
if (isLeft(H[_local3 - 1], H[_local3], P[_local2]) > 0) {
break;
}
_local3--;
}
_local3++;
H[_local3] = P[_local2];
}
if (_local11 != _local7) {
_local3++;
H[_local3] = P[_local11];
}
_local8 = _local3;
_local2 = _local7;
while (_local2-- , _local2 >= _local6) {
if ((isLeft(P[_local11], P[_local6], P[_local2]) >= 0) && (_local2 > _local6)) {
continue;
}
while (_local3 > _local8) {
if (isLeft(H[_local3 - 1], H[_local3], P[_local2]) > 0) {
break;
}
_local3--;
}
_local3++;
H[_local3] = P[_local2];
}
if (_local6 != _local10) {
_local3++;
H[_local3] = P[_local10];
}
return(_local3 + 1);
}
}
Symbol 421 MovieClip [__Packages.com.midasplayer.util.SineLookup] Frame 0
class com.midasplayer.util.SineLookup
{
static var thisInstance;
function SineLookup () {
var _local2 = PI2 / TABLE_SIZE;
var _local1 = 0;
while (_local1 < TABLE_SIZE) {
TABLE[_local1] = Math.sin(_local2 * _local1);
_local1++;
}
}
static function get instance() {
if (thisInstance == null) {
thisInstance = new com.midasplayer.util.SineLookup();
}
return(thisInstance);
}
function sin(rad) {
rad = rad % PI2;
rad = rad * TABLE_SIZE;
rad = rad / PI2;
rad = rad & TABLE_MASK;
return(TABLE[rad >> 0]);
}
function cos(rad) {
rad = rad % PI2;
rad = rad * TABLE_SIZE;
rad = rad / PI2;
rad = rad + QUART;
rad = rad & TABLE_MASK;
return(TABLE[rad >> 0]);
}
static var TABLE_SIZE = 16384;
static var TABLE_MASK = TABLE_SIZE - 1;
static var QUART = TABLE_SIZE / 4;
static var TABLE = new Array(TABLE_SIZE);
static var PI2 = (Math.PI*2);
}
Symbol 422 MovieClip [__Packages.midasplayer.goldfishbowl.Line] Frame 0
class midasplayer.goldfishbowl.Line
{
var x1, y1, x2, y2;
function Line (x1, y1, x2, y2) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
function toString() {
return(((("[" + [x1, y1]) + "]--[") + [x2, y2]) + "]");
}
}
Symbol 423 MovieClip [__Packages.com.midasplayer.util.EaseInQuadAnimator] Frame 0
class com.midasplayer.util.EaseInQuadAnimator extends com.midasplayer.util.Animator
{
var dt, duration, x, startX, dx, y, startY, dy, fillBaseCopy;
function EaseInQuadAnimator (o) {
super(o);
}
function nextPosition() {
var _local2 = dt * dt;
var _local3 = duration * duration;
x = ((dx * _local2) / _local3) + startX;
y = ((dy * _local2) / _local3) + startY;
}
function makeCopy(t) {
var _local2 = new com.midasplayer.util.EaseInQuadAnimator();
fillBaseCopy(t, _local2);
return(_local2);
}
}
Symbol 424 MovieClip [__Packages.com.midasplayer.timing.Timeable] Frame 0
interface com.midasplayer.timing.Timeable
{
}
Symbol 425 MovieClip [__Packages.midasplayer.goldfishbowl.Game] Frame 0
class midasplayer.goldfishbowl.Game implements midasplayer.goldfishbowl.IObjectManager, com.midasplayer.timing.Timeable
{
var lastTick, performance, allowExit, isGameOver, isGameOverInit, numFishingLines, levelInited, timer, tankLimits, totalScore, currentLevel, parent, collisionList, optimizeFlag, objects, lang, hasBeenForcedLow, random, levelIds, levelTimes, levelQualify, customHead, lp, m_hasHeadBeenInited, selectBox, fisherman, gameLogo, currentGameLogo, soundsEnabled, rodDrawer, rod, hook, lastPlate, nextInitLevel, numObject, spawnedExplosions, lastItemRepeats, lastItemTime, lastItem, hasSplashedUp, hasSplashedDown, droppingHook, releasingLine, lastHit, strengthSprite, secondsLevel, ticksLevel, levelPlayEnd, levelPlayBegin, scorePlateSprite;
function Game (parent) {
lastTick = -1;
performance = new com.midasplayer.timing.Performance(MOVIE_FPS);
performance.setFpsThreshold(MIN_FPS, MEASURE_TIME);
performance.addQualityFeedbackListener(mx.utils.Delegate.create(this, onLowQualityWarning));
allowExit = true;
isGameOver = false;
isGameOverInit = false;
numFishingLines = 0;
levelInited = false;
timer = new com.midasplayer.timing.Timer(this, 25);
tankLimits = new Object();
totalScore = 0;
currentLevel = 0;
this.parent = parent;
collisionList = [];
optimizeFlag = true;
objects = new com.midasplayer.util.Map();
lang = "en";
hasBeenForcedLow = false;
}
function enableLowQuality() {
if (!optimizeFlag) {
return(undefined);
}
parent._quality = "low";
hasBeenForcedLow = true;
}
function init(gda) {
random = new com.midasplayer.util.Random(gda.getGameData("randomseed"));
var _local3 = gda.getSubTrees("leveldata");
optimizeFlag = true;
lang = gda.getGameData("lang");
levelIds = gda.getGameData("order").split(",");
levelTimes = gda.getGameData("limits").split(",");
levelQualify = gda.getGameData("qualify").split(",");
customHead = gda.getGameData("head");
tankLimits.x = parent.tank._x;
tankLimits.y = parent.tank._y - 150;
tankLimits.w = 682;
tankLimits.h = 529;
lp = new midasplayer.goldfishbowl.LevelParser(parent, this, random, tankLimits, _local3, levelIds);
m_hasHeadBeenInited = false;
if (HAS_HEADS) {
selectBox = parent.attachMovie("pick_housemate", "selectbox", parent.getNextHighestDepth());
selectBox.init(mx.utils.Delegate.create(this, initHead));
} else {
initHead(-1, true);
}
}
function initHead(headId, isMale) {
if (!m_hasHeadBeenInited) {
m_hasHeadBeenInited = true;
var _local2 = 0;
if (isMale) {
_local2 = 1;
}
var _local3 = parent.tank.attachMovie("keruben", "cupid", parent.getNextHighestDepth());
fisherman = _local3;
fisherman.setGender(_local2);
fisherman.assignHead(headId, 0, 0, mx.utils.Delegate.create(this, continueInit));
}
}
function continueInit() {
var _local9 = 355;
var _local8 = 89;
fisherman.setPosition(_local9, _local8 - parent.tank._y);
gameLogo = new com.midasplayer.util.Sprite("gamelogo_goldfishbowl", 244.8, 56.8, 0, parent);
gameLogo.setVisible(true);
parent.gamelogo_static._visible = false;
currentGameLogo = parent.gamelogo_static;
parent.score_value_txt.text = "000000";
parent.time_value_txt.text = "01:00";
parent.bonus_value_txt.text = "x 0";
parent.exitbutton.button_txt.text = com.midasplayer.util.I18n.getString("exit_btn");
parent.soundbutton.sound_button_txt.text = com.midasplayer.util.I18n.getString("sound_off");
soundsEnabled = true;
var _local4 = new com.midasplayer.fx.Draw(parent.createEmptyMovieClip("tankmask_mc", parent.getNextHighestDepth()));
_local4.fillRect(0, 0, 700, 126);
_local4.fillRect(tankLimits.x, tankLimits.y, tankLimits.w, tankLimits.h - 16);
parent.tank.setMask(_local4.mc);
parent.bonus_btn.onPress = mx.utils.Delegate.create(this, onUseFishingline);
parent.tank.onPress = mx.utils.Delegate.create(this, onDropHook);
var _local6 = new Object();
_local6.onKeyDown = mx.utils.Delegate.create(this, onPressKey);
Key.addListener(_local6);
parent.score_box.score_txt.text = com.midasplayer.util.I18n.getString("score_label");
parent.time_box.time_txt.text = com.midasplayer.util.I18n.getString("time_label");
parent.bonus_btn.bonus_box.bonus_txt.text = com.midasplayer.util.I18n.getString("bonus_label");
rodDrawer = new com.midasplayer.fx.Draw();
rodDrawer.createClip(parent.tank);
rodDrawer.__set__color(102);
rodDrawer.__set__alpha(100);
rodDrawer.__set__thickness(4);
rod = new midasplayer.goldfishbowl.Rod(335, -120, 625, 0, 20);
rod.applyForce(3.14159, HOOK_WEIGHT);
rod.update(true);
hook = parent.tank.hook;
hook._visible = false;
hook.init(this, parent.tank, rod.__get__tip().x, rod.__get__tip().y);
hook.setTankLimits(tankLimits.x, tankLimits.y, tankLimits.w + tankLimits.x, (tankLimits.h + tankLimits.y) - 130);
var _local3 = parent.attachMovie("platta_intro", "platta", parent.getNextHighestDepth());
lastPlate = _local3;
_local3.setExitEvent(mx.utils.Delegate.create(this, begin));
_local3.init(1, 0, 1000, 2000);
_local3._x = PLATE_X;
_local3._y = PLATE_Y;
gameLogo.setDepth(LOGO_FRONT);
var _local7 = parent.attachMovie("backdrop", "gamebackdrop", parent.getNextHighestDepth());
parent.game_backdrop.swapDepths(_local7);
parent.game_backdrop.removeMovieClip();
parent.backdrop.swapDepths(104800);
parent.backdrop.removeMovieClip();
fisherman.setVisible(true);
com.midasplayer.fx.SoundManager.play("fishtheme_loop", 100, true);
parent.tank.hook.swapDepths(104800);
fscommand ("config", "contextmenu=false");
Stage.scaleMode = "noScale";
var _local5 = new ContextMenu();
_local5.hideBuiltInItems();
_local5.builtInItems.quality = true;
_root.menu = _local5;
selectBox.swapDepths(parent.getNextHighestDepth());
fscommand ("gameStart");
}
function gameLogoToFront() {
currentGameLogo._visible = false;
gameLogo.setDepth(parent.getNextHighestDepth());
gameLogo.setVisible(true);
gameLogo.approachAlpha(100, 500);
}
function gameLogoToBack() {
var cgl = currentGameLogo;
var _local2 = function (s) {
cgl._visible = true;
s.setVisible(false);
};
gameLogo.approachAlpha(25, 500, mx.utils.Delegate.create(this, _local2));
}
function begin() {
parent.onEnterFrame = mx.utils.Delegate.create(this, onEnterFrame);
fisherman.sitUp();
gameLogoToBack();
initializeLevel(0);
}
function initializeLevel(levelNum) {
levelInited = false;
nextInitLevel = levelNum;
}
function doInitializeLevel() {
if (doInitializeLevel > 3) {
return(undefined);
}
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.fx.SoundManager.play("level_start", 100, false, function () {
com.midasplayer.fx.SoundManager.play("ingame_loop", 33, true);
});
var _local2 = objects.__get__valueIterator();
while (_local2.hasNext()) {
_local2.next().item.destroy();
}
objects.clear();
numObject = 0;
objects = lp.initLevelByNumber(nextInitLevel);
_local2 = objects.__get__valueIterator();
while (_local2.hasNext()) {
_local2.next().item.approachAlpha(100, 250, function (spr) {
spr.setAlpha(100);
});
}
spawnedExplosions = new Array();
lastItemRepeats = 0;
lastItemTime = -1;
lastItem = undefined;
hasSplashedUp = false;
hasSplashedDown = false;
droppingHook = false;
releasingLine = false;
lastHit = 0;
rod = new midasplayer.goldfishbowl.Rod(335, -120, 625, 0, 20);
rod.applyForce(3.14159, HOOK_WEIGHT);
rod.update(true);
parent.tank.background.gotoAndStop((nextInitLevel % 4) + 1);
hook.reset();
if (strengthSprite != undefined) {
strengthSprite.destroy();
}
strengthSprite = undefined;
secondsLevel = levelTimes[nextInitLevel] * 1000;
ticksLevel = int(secondsLevel / timer.getMillisPerTick());
levelPlayEnd = levelPlayBegin + ticksLevel;
var _local3 = lp.getHookOffsetByLevel(nextInitLevel);
hook.pendulaStep(_local3);
nextInitLevel = -1;
levelInited = true;
}
function onToggleSoundButton() {
if (fisherman == undefined) {
return(undefined);
}
com.midasplayer.fx.SoundManager.enableSounds((soundsEnabled = !soundsEnabled));
parent.soundbutton.sound_button_txt.text = com.midasplayer.util.I18n.getString((soundsEnabled ? "sound_off" : "sound_on"));
}
function onExitButton() {
if (fisherman == undefined) {
return(undefined);
}
if (((!allowExit) || (isGameOverInit)) || (isGameOver)) {
return(undefined);
}
lastPlate.removeMovieClip();
onGameOver();
gameLogoToFront();
}
function onLowQualityWarning(fps) {
if (!hasBeenForcedLow) {
enableLowQuality();
}
}
function onPressKey() {
switch (Key.getCode()) {
case 38 :
onUseFishingline();
break;
case 40 :
case 32 :
onDropHook();
}
}
function onUseFishingline() {
if (numFishingLines == 0) {
return(undefined);
}
releasingLine = true;
}
function onDropHook(num) {
if (hook.canDropHook()) {
droppingHook = true;
}
}
function onReelIn(item) {
if (!levelInited) {
return(undefined);
}
var _local2 = 0;
if (item != undefined) {
_local2 = item.getWeight();
if (hook.getStrength()) {
_local2 = _local2 / 2;
}
}
com.midasplayer.fx.SoundManager.play("reel_in_loop", 100, true);
fisherman.reelIn(_local2);
}
function removeScorePlate() {
if (scorePlateSprite != undefined) {
scorePlateSprite.destroy();
scorePlateSprite = undefined;
}
}
function onCaughtItem(item) {
fisherman.idle();
com.midasplayer.fx.SoundManager.stop("reel_in_loop");
if ((((!levelInited) || (item == undefined)) || (isGameOverInit)) || (isGameOver)) {
return(undefined);
}
var _local5 = 0;
var _local7 = lastTick;
if (lastItemTime >= 0) {
var _local12 = _local7 - lastItemTime;
var _local8 = 10000 / timer.getMillisPerTick();
var _local11 = Math.min(_local12, _local8) / _local8;
_local5 = int(10 * (1 - _local11));
}
lastItemTime = _local7;
var _local4 = item.getName();
if (_local4 == lastItem) {
lastItemRepeats++;
} else {
lastItemRepeats = 0;
lastItem = _local4;
}
var _local3 = Math.max(1, (1 + lastItemRepeats) * 1);
com.midasplayer.fx.SoundManager.play("catch_" + Math.min(4, _local3));
var _local6 = 1 + ((currentLevel / 10) * 2);
var _local14 = ((item.getPoints() * _local6) * _local3) + _local5;
totalScore = totalScore + _local14;
parent.score_value_txt.text = com.midasplayer.util.Numbers.itoa(Math.min(999999, totalScore), 6);
if ((objects.count() > 0) && (item.getPoints() > 0)) {
removeScorePlate();
scorePlateSprite = new com.midasplayer.util.Sprite("pointbg", 216, 0, 0, parent);
var _local9 = scorePlateSprite.getMovieClip();
var _local13 = new com.midasplayer.util.Sprite(item.getName(), 220, 28, 0, _local9);
_local13.scaleFitInside(50, 50);
scorePlateSprite.delayedInvokation(2000, mx.utils.Delegate.create(this, removeScorePlate));
var _local10 = Math.round(_local6 * item.getPoints());
_local9.point_txt.text = (_local10 + "x") + Math.min(9, _local3);
}
}
function blastTankItem(item) {
var _local8 = parent.tank;
var _local7 = _local8.getNextHighestDepth();
var _local4 = getTimer();
var _local3 = 0;
for (var _local6 in spawnedExplosions) {
var _local2 = _local4 - spawnedExplosions[_local6];
if (_local2 < 500) {
_local3++;
}
}
if (_local3 < 5) {
var _local5 = _local8.attachMovie("expl", "boom_" + _local7, _local7);
_local5._x = item.getPosX();
_local5._y = item.getPosY();
_local5._rotation = Math.round(Math.random() * 360);
_local5._xscale = 200;
_local5._yscale = 200;
spawnedExplosions.push(_local4);
if (_local3 == 0) {
com.midasplayer.fx.SoundManager.play("blast");
}
}
removeTankItem(item);
}
function removeTankItem(item) {
var _local2 = objects.get(item.__get__uniqeId());
objects.remove(item.__get__uniqeId());
_local2.item.destroy();
}
function addTankItem(name, x, y) {
var _local5 = (name + "_d") + getTimer();
var _local3 = {x:x, y:y, rotation:"0", flip:"false"};
com.midasplayer.fx.SoundManager.play(name + "_drop");
objects.put(_local5, _local3);
var _local4 = lp.getDisplacementByName(name);
var _local2 = lp.attachTankItem(_local5, _local3, _local4[0], _local4[1]);
_local2.setScale(0);
_local2.setAlpha(0);
_local2.approachScale(100, 500, false);
_local2.approachAlpha(100, 250, function (spr) {
spr.setAlpha(100);
});
return(_local3.item);
}
function getItemsByProximity(origin, proximity) {
var _local7 = new Array();
var _local9 = origin.getPosX();
var _local8 = origin.getPosY();
proximity = proximity * proximity;
var _local3 = objects.__get__valueIterator();
while (_local3.hasNext()) {
var _local2 = _local3.next();
var _local5 = _local9 - _local2.item.getPosX();
var _local4 = _local8 - _local2.item.getPosY();
var _local6 = (_local5 * _local5) + (_local4 * _local4);
if (_local6 <= proximity) {
_local7.push(_local2.item);
}
}
return(_local7);
}
function bonusItemAcquired(name, bonusSprite) {
switch (name) {
case "strength_item" :
if (strengthSprite != undefined) {
bonusSprite.destroy();
return(undefined);
}
strengthSprite = bonusSprite;
bonusSprite.delayedInvokation(500, function (self) {
self.setRotation(0);
self.setScale(50);
self.setPosition(660, 0);
});
hook.setStrength(true);
break;
case "doublehook_item" :
bonusSprite.delayedInvokation(500, function (self) {
self.destroy();
});
hook.setBigHook(true);
break;
case "fishingline_item" :
bonusSprite.delayedInvokation(500, function (self) {
self.destroy();
});
numFishingLines++;
parent.bonus_btn.bonus_value_txt.text = "x " + numFishingLines;
}
}
function onLevelComplete() {
fisherman.idle();
removeScorePlate();
levelInited = false;
if (currentLevel < (levelIds.length - 1)) {
com.midasplayer.fx.SoundManager.stopAll();
var _local3 = levelQualify[currentLevel];
var _local4 = levelQualify[currentLevel + 1];
var _local2 = parent.attachMovie("platta_levelover", "platta", parent.getNextHighestDepth());
lastPlate = _local2;
if (_local3 > totalScore) {
com.midasplayer.fx.SoundManager.play("game_over");
allowExit = false;
_local2.setExitEvent(mx.utils.Delegate.create(this, doGameOver));
} else {
com.midasplayer.fx.SoundManager.play("level_complete");
_local2.setExitEvent(mx.utils.Delegate.create(this, doLevelCompleteSignRemoved));
}
_local2.init(++currentLevel, totalScore, _local3, _local4);
_local2._x = PLATE_X;
_local2._y = PLATE_Y;
} else {
onGameOver();
}
gameLogoToFront();
}
function doLevelCompleteSignRemoved() {
gameLogoToBack();
initializeLevel(currentLevel);
}
function onGameOver() {
if (isGameOverInit) {
return(undefined);
}
isGameOverInit = true;
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.fx.SoundManager.play("game_over");
var _local2 = parent.attachMovie("platta_gameover", "platta", parent.getNextHighestDepth());
lastPlate = _local2;
_local2.setExitEvent(mx.utils.Delegate.create(this, doGameOver));
_local2.init(++currentLevel, totalScore);
_local2._x = PLATE_X;
_local2._y = PLATE_Y;
}
function doGameOver() {
if (isGameOver) {
return(undefined);
}
isGameOver = true;
fscommand ("gameOver", totalScore);
parent.onEnterFrame = undefined;
var _local2 = objects.__get__valueIterator();
while (_local2.hasNext()) {
_local2.next().item.destroy();
}
objects.clear();
gameLogoToBack();
}
function onEnterFrame() {
timer.advanceTime2();
performance.frameUpdated();
}
function checkCollisions() {
var _local5 = hook.getBoundBox();
var _local11 = _local5.getArea();
var _local6 = objects.__get__valueIterator();
while (_local6.hasNext()) {
var _local4 = _local6.next();
var _local2 = _local4.bounds;
if (!_local5.mayCollide(_local2)) {
} else {
var _local3 = _local2.getArea();
if (_local11 < _local3) {
if (_local5.intersectsWith(_local2)) {
var _local10 = _local5.getOverlapArea();
var _local8 = _local10 / _local11;
if (_local8 > 0.2) {
collisionList.push({obj:_local4, score:(_local8 * _local3) + _local2.getPositionKey()});
}
}
} else if (_local2.intersectsWith(_local5)) {
var _local9 = _local2.getOverlapArea();
var _local7 = _local9 / _local3;
if (_local7 > 0.05) {
collisionList.push({obj:_local4, score:(_local7 * _local3) + _local2.getPositionKey()});
}
}
}
}
}
function tick(tick) {
lastTick = tick;
if (nextInitLevel != -1) {
levelPlayBegin = tick;
doInitializeLevel();
performance.begin();
}
hook.update(levelInited);
fisherman.update(hook);
rod.update();
var _local6 = hook.getDirection();
var _local7 = HOOK_WEIGHT + ((_local6 < 0) ? 5 : 0);
if (hook.hasCatch()) {
rod.__set__lineSlack(5);
var _local9 = hook.getCaughtItem().getWeight();
_local7 = _local7 + _local9;
if (_local9 >= 10) {
_local7 = _local7 + (com.midasplayer.util.SineLookup.__get__instance().sin(hook.getAngle()) * 10);
}
} else {
rod.__set__lineSlack(((_local6 < 0) ? (((1 - (hook.getLineLength() / 400)) * 15) + 15) : 30));
}
rod.applyForce(Math.PI, _local7);
hook.setRodTip(fisherman.tipX, fisherman.tipY);
var _local3 = objects.__get__valueIterator();
while (_local3.hasNext()) {
_local3.next().item.update();
}
var _local5;
var _local4 = 0;
collisionList = [];
if (_local6 > 0) {
checkCollisions();
var _local2 = 0;
while (_local2 < collisionList.length) {
if (collisionList[_local2].score > _local4) {
_local5 = collisionList[_local2].obj;
_local4 = collisionList[_local2].score;
}
_local2++;
}
}
if (levelInited && (fisherman.ready)) {
if (((_local6 > 0) && (hook._y > 10)) && (!hasSplashedDown)) {
com.midasplayer.fx.SoundManager.play("bow_shoot");
hasSplashedDown = true;
}
if ((((_local6 < 0) && (hook._y < 10)) && (hasSplashedDown)) && (!hasSplashedUp)) {
hasSplashedUp = true;
}
if (_local5 != undefined) {
var _local8;
if (_local5.item.onCatch()) {
objects.remove(_local5.item.uniqeId);
_local8 = _local5;
lastHit = _local4;
}
hook.retractHook(_local8);
}
if (droppingHook) {
hook.releaseHook();
droppingHook = false;
hasSplashedDown = false;
hasSplashedUp = false;
}
if (releasingLine) {
if (hook.attachNewFishingline()) {
fisherman.idle();
releasingLine = false;
numFishingLines--;
parent.bonus_btn.bonus_value_txt.text = "x " + numFishingLines;
com.midasplayer.fx.SoundManager.stop("reel_in_loop");
}
}
if ((tick == levelPlayEnd) || ((objects.count() == 0) && (!hook.hasCatch()))) {
onLevelComplete();
}
}
}
function render(tick, alpha) {
if (levelInited) {
var _local8 = levelPlayEnd - levelPlayBegin;
var _local10 = tick - levelPlayBegin;
var _local6 = 1 - (_local10 / _local8);
_local6 = _local6 * secondsLevel;
_local6 = int(_local6);
parent.time_value_txt.text = com.midasplayer.util.Numbers.asTime(_local6, false, true);
}
if (!fisherman.ready) {
return(undefined);
}
var _local2 = objects.__get__valueIterator();
while (_local2.hasNext()) {
_local2.next().item.updatePosition(alpha);
}
var _local9;
_local9 = hook.getCaughtItem();
if (_local9 != undefined) {
_local9.updatePosition(alpha);
}
var _local7;
_local7 = hook.getFallingHook();
if (_local7 != undefined) {
_local7.getCaughtItem().updatePosition(alpha);
}
hook._visible = true;
rodDrawer.clear();
rodDrawer.__set__color(16711680);
rodDrawer.__set__thickness(1);
rodDrawer.drawLine(hook._x, hook._y, fisherman.tipX, fisherman.tipY);
var _local4 = fisherman._x;
var _local3 = fisherman._y;
if (hook.getDirection() == 0) {
rodDrawer.drawLine(_local4 + fisherman.bow2._x, _local3 + fisherman.bow2._y, _local4 + fisherman.bow3._x, _local3 + fisherman.bow3._y);
rodDrawer.drawLine(_local4 + fisherman.bow4._x, _local3 + fisherman.bow4._y, _local4 + fisherman.bow1._x, _local3 + fisherman.bow1._y);
} else {
rodDrawer.drawLine(_local4 + fisherman.bow1._x, _local3 + fisherman.bow1._y, _local4 + fisherman.bow2._x, _local3 + fisherman.bow2._y);
}
}
static var HAS_HEADS = true;
static var RADIAN_TO_DEGREE = 57.2957795;
static var DEGREE_TO_RADIAN = 0.0174532925;
static var HOOK_WEIGHT = 40;
static var PLATE_X = 78.5;
static var PLATE_Y = 82.5;
static var MOVIE_FPS = 60;
static var MEASURE_TIME = 5;
static var MIN_FPS = 15;
static var numberOrder = "0123456789:x";
static var LOGO_BACK = 0;
static var LOGO_FRONT = 75000;
}
Symbol 426 MovieClip [__Packages.com.midasplayer.timing.Performance] Frame 0
class com.midasplayer.timing.Performance
{
var idealFps, measurePeriod, minPeriodFps, listeners, startAt, period, nextFpsUpdate, totalFps, fpsCount, lastFpsCount, periodFps, updates;
function Performance (idealFps) {
this.idealFps = idealFps;
measurePeriod = 5;
minPeriodFps = (idealFps / 2) * measurePeriod;
listeners = [];
begin();
}
function begin() {
startAt = -1;
period = -1;
nextFpsUpdate = getTimer();
totalFps = 0;
fpsCount = 0;
lastFpsCount = -1;
periodFps = 0;
updates = 0;
}
function frameUpdated() {
fpsCount++;
var _local3 = getTimer();
if (startAt < 0) {
startAt = _local3;
}
if (_local3 > nextFpsUpdate) {
if (updates > 0) {
lastFpsCount = fpsCount;
totalFps = totalFps + fpsCount;
}
periodFps = periodFps + fpsCount;
if ((++period) == measurePeriod) {
if (periodFps < minPeriodFps) {
for (var _local2 in listeners) {
listeners[_local2](periodFps / measurePeriod);
}
}
period = 0;
periodFps = 0;
}
nextFpsUpdate = _local3 + 1000;
fpsCount = 0;
updates++;
}
}
function addQualityFeedbackListener(fn) {
listeners.push(fn);
}
function setFpsThreshold(minPeriodFps, measurePeriod) {
this.minPeriodFps = minPeriodFps * measurePeriod;
this.measurePeriod = measurePeriod;
}
function get fps() {
return(lastFpsCount);
}
function get averageFps() {
return(totalFps / ((getTimer() - startAt) / 1000));
}
}
Symbol 427 MovieClip [__Packages.com.midasplayer.util.GameDataAcquirer] Frame 0
class com.midasplayer.util.GameDataAcquirer
{
var attrib, trees, targetVar, dataEvent, timerFn, timer, error;
function GameDataAcquirer (variable) {
attrib = new com.midasplayer.util.Map();
trees = new com.midasplayer.util.Map();
if (variable != undefined) {
targetVar = variable;
} else {
targetVar = "gameData";
}
}
function beginWait(fn) {
dataEvent = fn;
timerFn = function (caller) {
var _local1 = _level0[caller.targetVar];
if (((_local1 != undefined) && (_local1 != null)) && (_local1.length > 0)) {
caller.parse(_local1);
if (caller.dataEvent != undefined) {
caller.dataEvent();
}
caller.dataEvent = undefined;
clearInterval(caller.timer);
}
};
timer = setInterval(timerFn, 100, this);
}
function poll() {
if (!parsed) {
var _local2 = _level0[targetVar];
if (((_local2 != undefined) && (_local2 != null)) && (_local2.length > 0)) {
parse(_local2);
parsed = true;
return(true);
}
}
return(false);
}
function getAttributes() {
return(attrib);
}
function getSubTrees(name) {
return(trees.get(name));
}
function getGameData(name) {
return(attrib.get(name));
}
function parse(data) {
attrib.clear();
var _local7 = new com.midasplayer.util.Map();
var _local9 = new XML();
_local9.ignoreWhite = true;
_local9.parseXML(data);
var _local4 = _local9.firstChild;
if (_local4.nodeName != "gamedata") {
error = "Bad XML (expected <gamedata>)";
return(undefined);
}
for (var _local8 in _local4.attributes) {
var _local5;
var _local3 = _local4.attributes[_local8];
if ((_local3.indexOf("[") == 0) && ((_local5 = _local3.indexOf("]")) != -1)) {
_local3 = _local3.substring(1, _local5).split(",");
}
attrib.put(_local8, _local3);
}
for (var _local8 in _local4.childNodes) {
var _local2 = _local4.childNodes[_local8];
switch (_local2.nodeName) {
case "text" :
_local7.put(_local2.attributes.id, _local2.firstChild.nodeValue);
break;
default :
var _local6;
_local6 = trees.get(_local2.nodeName);
if (_local6 == undefined) {
trees.put(_local2.nodeName, [_local2]);
} else {
_local6.push(_local2);
}
}
}
com.midasplayer.util.I18n.init(_local7);
}
var parsed = false;
}
Symbol 428 MovieClip [__Packages.com.midasplayer.util.Random] Frame 0
class com.midasplayer.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function nextDouble() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
s = int(s);
var _local6 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
var _local4 = N;
mti = 1;
while (mti < _local4) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local7 = getTimer();
}
function genrand_int32() {
var _local9 = N;
var _local3 = 0;
if (mti >= _local9) {
if (mti == (_local9 + 1)) {
init_genrand(5489);
}
var _local8 = M;
var _local6 = UPPER_MASK;
var _local4 = LOWER_MASK;
var _local5 = mag01;
var _local11 = getTimer();
var _local2 = 0;
var _local7 = _local9 - _local8;
var _local10 = _local8 - _local9;
_local2 = 0;
while (_local2 < _local7) {
_local3 = (mta[_local2] & _local6) | (mta[_local2 + 1] & _local4);
mta[_local2] = (mta[_local2 + _local8] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
_local2++;
}
_local7 = _local9 - 1;
while (_local2 < _local7) {
_local3 = (mta[_local2] & _local6) | (mta[_local2 + 1] & _local4);
mta[_local2] = (mta[_local2 + _local10] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
_local2++;
}
_local3 = (mta[_local9 - 1] & _local6) | (mta[0] & _local4);
mta[_local9 - 1] = (mta[_local8 - 1] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
mti = 0;
var _local12 = getTimer();
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 429 MovieClip [__Packages.com.midasplayer.util.Integer64] Frame 0
class com.midasplayer.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << 15)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << 15) >> 2)) | ((p[4] << 30) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / 15) >> 0;
var _local5 = step - (_local4 * 15);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & 32767;
_local4 = _local4 >> 15;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & 32767;
num = num >> 15;
var _local6 = num & 32767;
num = num >> 15;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & 32767;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & 32767;
num = num >>> 15;
s[1] = num & 32767;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & 32767;
_local3 = _local3 >> 15;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & 32767;
_local3 = _local3 >> 15;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & 32767;
_local3 = _local3 >> 15;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & 32767;
_local3 = _local3 >> 15;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & 32767;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new com.midasplayer.util.Integer64(value));
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
}
Symbol 430 MovieClip [__Packages.com.midasplayer.fx.Draw] Frame 0
class com.midasplayer.fx.Draw
{
var clip, colorVal, thicknessVal, alphaVal, __get__color, __get__alpha, __get__thickness;
function Draw (mc) {
clip = mc;
colorVal = 16777215 /* 0xFFFFFF */;
thicknessVal = 1.5;
alphaVal = 255;
}
function clone() {
var _local2 = new com.midasplayer.fx.Draw();
_local2.clip = clip;
_local2.thicknessVal = thicknessVal;
_local2.colorVal = colorVal;
_local2.alphaVal = alphaVal;
return(_local2);
}
function createClip(parent) {
var _local2 = parent.getNextHighestDepth();
clip = parent.createEmptyMovieClip("fx_draw_" + count, _local2);
count++;
}
function set color(v) {
colorVal = v;
//return(__get__color());
}
function set alpha(v) {
alphaVal = v;
//return(__get__alpha());
}
function set thickness(v) {
thicknessVal = v;
//return(__get__thickness());
}
function clear() {
clip.clear();
}
function fillInverseRect(param) {
var _local3 = param[0];
var _local9 = param[1];
var _local6 = _local3 + param[2];
var _local10 = _local9 + param[3];
var _local8 = param[4];
var _local2 = param[5];
var _local7 = _local8 + param[6];
var _local5 = _local2 + param[7];
if (_local2 > _local9) {
fillRect(_local3, _local9, _local6, _local2);
}
if (_local5 < _local10) {
fillRect(_local3, _local5, _local6, _local10 - _local5);
}
if (_local8 > _local3) {
fillRect(_local3, _local2, _local8 - _local3, _local5 - _local2);
}
if (_local7 < _local6) {
fillRect(_local7, _local2, _local6 - _local7, _local5 - _local2);
}
}
function fillRect(left, top, width, height) {
clip.endFill();
clip.beginFill(colorVal, alphaVal);
clip.moveTo(left, top);
clip.lineTo(left + width, top);
clip.lineTo(left + width, top + height);
clip.lineTo(left, top + height);
clip.lineTo(left, top);
clip.endFill();
}
function fillRectangle(r) {
fillRect(r.__get__x1(), r.__get__y1(), r.__get__x2() - r.__get__x1(), r.__get__y2() - r.__get__y1());
}
function drawBox(left, top, width, height) {
drawLine(left, top, left + width, top);
drawLine(left, top, left, top + height);
drawLine(left + width, top + height, left + width, top);
drawLine(left + width, top + height, left, top + height);
}
function drawLine(x1, y1, x2, y2) {
clip.lineStyle(thicknessVal, colorVal, alphaVal);
clip.moveTo(x1, y1);
clip.lineTo(x2, y2);
}
function fillPolygon(points) {
clip.beginFill(colorVal, alphaVal);
clip.moveTo(points[0], points[1]);
var _local2 = 1;
var _local5 = points.length / 2;
while (_local2 < _local5) {
var _local3 = _local2 << 1;
clip.lineTo(points[_local3], points[_local3 + 1]);
_local2++;
}
clip.lineTo(points[0], points[1]);
clip.endFill();
}
function get mc() {
return(clip);
}
static var count = 1;
}
Symbol 431 MovieClip [__Packages.com.midasplayer.geom.Rectangle] Frame 0
class com.midasplayer.geom.Rectangle
{
var px, py, width, height;
function Rectangle (x, y, w, h) {
px = x;
py = y;
width = w;
height = h;
}
function get x1() {
return(px);
}
function get y1() {
return(py);
}
function get x2() {
return(px + width);
}
function get y2() {
return(py + height);
}
function get isValid() {
return((width > 0) && (height > 0));
}
function setPosition(x, y) {
px = x;
py = y;
}
function isInside(x, y) {
return((((x >= px) && (x < (px + width))) && (y >= py)) && (y < (py + height)));
}
function isIntersect(other) {
var _local4 = px;
var _local3 = other.px;
var _local8 = px + width;
var _local7 = other.px + other.width;
var _local6 = py;
var _local5 = other.py;
var _local10 = py + height;
var _local9 = other.py + other.height;
return(!((((_local10 < _local5) || (_local6 > _local9)) || (_local8 < _local3)) || (_local4 > _local7)));
}
function getIntersection(other) {
var _local4 = px;
var _local3 = other.px;
var _local8 = px + width;
var _local7 = other.px + other.width;
var _local6 = py;
var _local5 = other.py;
var _local10 = py + height;
var _local9 = other.py + other.height;
if ((((_local10 < _local5) || (_local6 > _local9)) || (_local8 < _local3)) || (_local4 > _local7)) {
return(INVALID);
}
var _local13 = ((_local10 > _local9) ? (_local9) : (_local10));
var _local12 = ((_local6 < _local5) ? (_local5) : (_local6));
var _local14 = ((_local8 > _local7) ? (_local7) : (_local8));
var _local11 = ((_local4 < _local3) ? (_local3) : (_local4));
var _local16 = _local14 - _local11;
var _local15 = _local13 - _local12;
return(new com.midasplayer.geom.Rectangle(_local11, _local12, _local16, _local15));
}
function toString() {
return(((((((("Rectangle[" + x1) + ",") + y1) + " -- ") + x2) + ",") + y2) + "]");
}
static var INVALID = new com.midasplayer.geom.Rectangle(0, 0, -1000, -1000);
}
Symbol 432 MovieClip [__Packages.midasplayer.goldfishbowl.Rod] Frame 0
class midasplayer.goldfishbowl.Rod
{
var r, rs, rc, a, tick, slack, startX, startY, endX, endY, numVert, list, points, pl, tipY, tipX, __get__lineSlack;
function Rod (x1, y1, x2, y2, vertices) {
r = 0;
var _local2 = com.midasplayer.util.SineLookup.__get__instance();
rs = _local2.sin(r);
rc = _local2.cos(r);
a = 0;
tick = 0;
slack = 30;
startX = x1;
startY = y1;
endX = x2;
endY = y2;
numVert = vertices;
init();
}
function setStartPos(x, y) {
startX = x;
startY = y;
init();
}
function setEndPos(x, y) {
endX = x;
endY = y;
init();
}
function init() {
list = new Array(numVert);
points = new Array(numVert);
var _local10 = endX - startX;
var _local4 = _local10 / numVert;
var _local9 = endY - startY;
var _local3 = _local9 / numVert;
var _local6 = startX;
var _local5 = startY;
pl = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local2 = 0;
while (_local2 < numVert) {
list[_local2] = {x:_local6, y:_local5, sx:0, sy:0};
points[_local2] = {x:0, y:0};
_local6 = _local6 + _local4;
_local5 = _local5 + _local3;
_local2++;
}
update(true);
}
function get tip() {
return({x:tipX, y:tipY});
}
function get numpoints() {
return(numVert);
}
function get state() {
return([tipX, tipY, list[0].sx, list[0].sy, tick]);
}
function applyForce(ra, an) {
r = ra;
a = an;
var _local2 = com.midasplayer.util.SineLookup.__get__instance();
rs = _local2.sin(r);
rc = _local2.cos(r);
}
function update(stiff) {
var _local3 = a;
var _local5 = Math.pow(6, -2 / numVert);
var _local16 = 0;
var _local15 = 0;
if ((stiff == false) || (stiff == undefined)) {
var _local7 = 0.8;
var _local6 = 0.55;
var _local2 = 0;
while (_local2 < numVert) {
var _local4 = list[_local2];
_local3 = _local3 * _local5;
var _local13 = (-points[_local2].x) + (_local4.x + (rs * _local3));
var _local12 = (-points[_local2].y) + (_local4.y - (rc * _local3));
list[_local2].sx = (list[_local2].sx * _local7) + (_local13 * _local6);
list[_local2].sy = (list[_local2].sy * _local7) + (_local12 * _local6);
if (Math.abs(list[_local2].sx) < 1E-6) {
list[_local2].sx = 0;
}
if (Math.abs(list[_local2].sy) < 1E-6) {
list[_local2].sy = 0;
}
points[_local2].x = points[_local2].x + list[_local2].sx;
points[_local2].y = points[_local2].y + list[_local2].sy;
_local2++;
}
tick++;
} else {
var _local2 = 0;
while (_local2 < numVert) {
var _local4 = list[_local2];
_local3 = _local3 * _local5;
points[_local2].x = _local4.x + (rs * _local3);
points[_local2].y = _local4.y - (rc * _local3);
_local2++;
}
}
var _local13 = points[0].x;
var _local12 = points[0].y;
var _local11 = points[1].x;
var _local10 = points[1].y;
var _local8 = com.midasplayer.util.XPMath.atan2(_local10 - _local12, _local11 - _local13) + (Math.PI/2);
var _local9 = com.midasplayer.util.SineLookup.__get__instance();
tipX = points[0].x + (_local9.cos(_local8) * 5);
tipY = points[0].y + (_local9.sin(_local8) * 5);
}
function getPoint(p) {
return(points[p]);
}
function set lineSlack(slack) {
this.slack = slack;
//return(__get__lineSlack());
}
function paint(contex, roll) {
var _local12 = points[0];
contex.__set__thickness(4);
contex.__set__color(0);
var _local6 = 1;
while (_local6 < numVert) {
var _local7 = points[_local6];
var _local8 = (numVert - _local6) / numVert;
if (_local8 < 0.4) {
contex.__set__thickness(7);
contex.__set__color(8419129);
} else {
contex.__set__thickness((1.5 - _local8) * 3);
contex.__set__color(0);
}
contex.drawLine(_local12.x, _local12.y, _local7.x, _local7.y);
_local12 = _local7;
_local6++;
}
var _local10 = 4;
contex.__set__color(0);
contex.__set__thickness(1);
var _local9 = null;
_local6 = 0;
while (_local6 < _local10) {
var _local8 = 1.3 - ((_local10 - _local6) / _local10);
_local8 = _local8 / 1.5;
var _local2 = Math.floor(_local6 * 5);
var _local11 = _local2 + 1;
var _local19 = points[_local2].x;
var _local18 = points[_local2].y;
var _local16 = points[_local11].x;
var _local15 = points[_local11].y;
var _local4 = com.midasplayer.util.XPMath.atan2(_local15 - _local18, _local16 - _local19) + (Math.PI/2);
var _local5 = com.midasplayer.util.SineLookup.__get__instance();
_local19 = _local19 + (_local5.cos(_local4) * 5);
_local18 = _local18 + (_local5.sin(_local4) * 5);
if (_local9 != null) {
var _local14 = points[_local2 - 3].x;
var _local13 = points[_local2 - 3].y;
contex.__get__mc().lineStyle(0.5, 102, 100);
contex.__get__mc().moveTo(_local9.x, _local9.y);
if (_local6 == (_local10 - 1)) {
roll._x = _local19;
roll._y = _local18;
_local19 = points[_local2].x + (_local5.cos(_local4) * 10);
_local18 = points[_local2].y + (_local5.sin(_local4) * 10);
}
contex.__get__mc().curveTo(_local14 + ((_local5.cos(_local4) * slack) * _local8), _local13 + ((_local5.sin(_local4) * slack) * _local8), _local19, _local18);
}
contex.__set__thickness(1);
contex.drawLine(points[_local2].x, points[_local2].y, _local19, _local18);
_local9 = {x:_local19, y:_local18};
_local6++;
}
}
}
Symbol 433 MovieClip [__Packages.com.midasplayer.util.XPMath] Frame 0
class com.midasplayer.util.XPMath
{
function XPMath () {
}
static function atan2(y, x) {
var _local3 = Math.PI;
var _local4 = 1.5707963267949 /* Math.PI/2 */;
if (x == 0) {
if (y > 0) {
return(_local4);
}
if (y == 0) {
return(0);
}
return(-_local4);
}
var _local2;
var _local1 = y / x;
if (Math.abs(_local1) < 1) {
_local2 = _local1 / (1 + ((0.28 * _local1) * _local1));
if (x < 0) {
if (y < 0) {
return(_local2 - _local3);
}
return(_local2 + _local3);
}
} else {
_local2 = _local4 - (_local1 / ((_local1 * _local1) + 0.28));
if (y < 0) {
return(_local2 - _local3);
}
}
return(_local2);
}
static function atan(x) {
var _local2 = 0;
if (x < -2.41421356237309) {
var _local3 = 1 / x;
_local2 = -1.5707963267949 - (_local3 * (1 - ((_local3 * _local3) * (0.333333333333333 - ((_local3 * _local3) / 5)))));
} else if (x < -1) {
var _local3 = (1 + (x * 0.414213562373095)) / (0.414213562373095 - x);
_local2 = (-1.5707963267949 + (_local3 * (1 - ((_local3 * _local3) * (0.333333333333333 - ((_local3 * _local3) / 5)))))) + 0.392699081698724;
} else if (x < -0.414213562373095) {
var _local3 = (x + 0.414213562373095) / ((0.414213562373095 * x) - 1);
_local2 = (-(_local3 * (1 - ((_local3 * _local3) * (0.333333333333333 - ((_local3 * _local3) / 5)))))) - 0.392699081698724;
} else if (x < 0.414213562373095) {
_local2 = x * (1 - ((x * x) * (0.333333333333333 - ((x * x) / 5))));
} else if (x < 1) {
var _local3 = (x - 0.414213562373095) / (1 + (0.414213562373095 * x));
_local2 = (_local3 * (1 - ((_local3 * _local3) * (0.333333333333333 - ((_local3 * _local3) / 5))))) + 0.392699081698724;
} else if (x < 2.41421356237309) {
var _local3 = (1 - (x * 0.414213562373095)) / (x + 0.414213562373095);
_local2 = (1.5707963267949 /* Math.PI/2 */ - (_local3 * (1 - ((_local3 * _local3) * (0.333333333333333 - ((_local3 * _local3) / 5)))))) - 0.392699081698724;
} else {
var _local3 = 1 / x;
_local2 = 1.5707963267949 /* Math.PI/2 */ - (_local3 * (1 - ((_local3 * _local3) * (0.333333333333333 - ((_local3 * _local3) / 5)))));
}
return(_local2);
}
static function cos(f) {
var _local2 = 0;
var _local1 = ((f > 0) ? (f) : (-f));
if (_local1 >= 14.1371669411541) {
_local2 = int(_local1 * 0.636619772367581);
if ((_local2 & 1) != 0) {
_local2++;
}
_local1 = _local1 - (_local2 * 1.5707963267949 /* Math.PI/2 */);
} else if (_local1 < 1.5707963267949 /* Math.PI/2 */) {
} else if (_local1 < 4.71238898038469) {
_local1 = _local1 - Math.PI;
_local2 = 2;
} else if (_local1 < 7.85398163397448) {
_local1 = _local1 - (Math.PI*2);
} else if (_local1 < 10.9955742875643) {
_local1 = _local1 - 9.42477796076938;
_local2 = 2;
} else {
_local1 = _local1 - 12.5663706143592;
}
var _local3 = _local1 * _local1;
var _local4 = 0.999999953027512 + (_local3 * (-0.499999047777921 + (_local3 * (0.041663573160188 + (_local3 * (-0.0013853629536173 + (_local3 * 2.31524166599385E-5)))))));
return((((_local2 & 2) != 0) ? (-_local4) : (_local4)));
}
static function sin(f) {
f = f - 1.5707963267949 /* Math.PI/2 */;
var _local2 = 0;
var _local1 = ((f > 0) ? (f) : (-f));
if (_local1 >= 14.1371669411541) {
_local2 = int(_local1 * 0.636619772367581);
if ((_local2 & 1) != 0) {
_local2++;
}
_local1 = _local1 - (_local2 * 1.5707963267949 /* Math.PI/2 */);
} else if (_local1 < 1.5707963267949 /* Math.PI/2 */) {
} else if (_local1 < 4.71238898038469) {
_local1 = _local1 - Math.PI;
_local2 = 2;
} else if (_local1 < 7.85398163397448) {
_local1 = _local1 - (Math.PI*2);
} else if (_local1 < 10.9955742875643) {
_local1 = _local1 - 9.42477796076938;
_local2 = 2;
} else {
_local1 = _local1 - 12.5663706143592;
}
var _local3 = _local1 * _local1;
var _local4 = 0.999999953027512 + (_local3 * (-0.499999047777921 + (_local3 * (0.041663573160188 + (_local3 * (-0.0013853629536173 + (_local3 * 2.31524166599385E-5)))))));
return((((_local2 & 2) != 0) ? (-_local4) : (_local4)));
}
}
Symbol 434 MovieClip [__Packages.midasplayer.goldfishbowl.Hook] Frame 0
class midasplayer.goldfishbowl.Hook extends MovieClip
{
var bounds, dropSpeed, hasBigHook, isReleased, hasStrength, pendula, rodx, rody, game, parent, lineLength, initialized, windingDirection, lastAngle, windUpPendula, posx, posy, rot, caught, reelSlowdown, tankRight, tankLeft, tankBottom, _x, _y, _rotation, tankTop, clear, lineStyle, moveTo, lineTo, creator, swapDepths, removeMovieClip, fallingHook, gotoAndStop, sinkUpdateTimer, grabX, grabY;
function Hook () {
super();
bounds = new midasplayer.goldfishbowl.BoundBox(0, 0, 9, 14, 0);
dropSpeed = 10;
hasBigHook = false;
isReleased = false;
hasStrength = false;
reset();
}
function get updateCount() {
return(pendula.__get__tick());
}
function setRodTip(x, y) {
rodx = x;
rody = y;
}
function init(game, parent, x, y) {
this.game = game;
this.parent = parent;
rodx = x;
rody = y;
lineLength = MIN_LENGTH;
initialized = true;
}
function pendulaStep(steps) {
var _local2 = 0;
while (_local2 < steps) {
pendula.update(true);
_local2++;
}
}
function update(levelInited) {
if (!initialized) {
return(undefined);
}
pendula.update(false);
if (windingDirection == 0) {
lastAngle = pendula.angle;
}
if ((windUpPendula != undefined) && (windingDirection < 0)) {
windUpPendula.update();
lastAngle = windUpPendula.angle;
}
var _local3 = DEGREE_TO_RADIAN * lastAngle;
var _local8 = com.midasplayer.util.SineLookup.__get__instance();
var _local4 = _local8.sin(_local3);
var _local5 = _local8.cos(_local3);
posx = (_local4 * lineLength) + rodx;
posy = (_local5 * lineLength) + rody;
rot = -lastAngle;
bounds.setPosition(posx + (_local4 * 7), posy + (_local5 * 7), -_local3);
var _local2 = -20;
if (caught != undefined) {
var _local6 = midasplayer.goldfishbowl.TankItem.ITEM[caught.item.getName()];
if (_local6.yoffs != undefined) {
_local2 = _local6.yoffs;
}
caught.item.updateCaught(posx, posy, -lastAngle);
posx = caught.item.getPosX() + (_local4 * _local2);
posy = caught.item.getPosY() + (_local5 * _local2);
}
if (levelInited && (windingDirection < 0)) {
var _local7 = 1;
if (caught != undefined) {
_local7 = (100 - caught.item.getWeight()) / 100;
}
var _local9 = (10 * _local7) - ((reelSlowdown = reelSlowdown / 5));
_local9 = _local9 * (hasStrength ? 2 : 1);
lineLength = lineLength - _local9;
if (lineLength <= (MIN_LENGTH - _local2)) {
lineLength = MIN_LENGTH;
windingDirection = 0;
onReleaseItem();
}
}
if (windingDirection > 0) {
lineLength = lineLength + dropSpeed;
if (((posx > tankRight) || (posx < tankLeft)) || (posy > tankBottom)) {
windingDirection = -1;
game.onReelIn();
}
}
_x = posx;
_y = posy;
_rotation = rot;
}
function setTankLimits(left, top, right, bottom) {
tankLeft = left;
tankTop = top;
tankRight = right;
tankBottom = bottom;
}
function onEnterFrame() {
if (!isReleased) {
return(undefined);
}
clear();
lineStyle(1, 16711680, 100);
moveTo(0, 0);
lineTo(0, -lineLength);
if (caught) {
var _local3 = DEGREE_TO_RADIAN * lastAngle;
var _local4 = com.midasplayer.util.SineLookup.__get__instance();
var _local6 = _local4.sin(_local3);
var _local7 = _local4.cos(_local3);
var _local5 = -20;
var _local2 = midasplayer.goldfishbowl.TankItem.ITEM[caught.item.getName()];
if (_local2.yoffs != undefined) {
_local5 = _local2.yoffs;
}
caught.item.updateCaught(posx, posy, -lastAngle);
}
if ((posy - lineLength) > tankBottom) {
if (caught) {
caught.item.destroy();
caught.shadow.destroy();
caught = undefined;
}
clearInterval(creator.sinkUpdateTimer);
creator.sinkUpdateTimer = undefined;
creator.fallingHook = undefined;
swapDepths(1048000);
removeMovieClip();
return(undefined);
}
_x = posx;
_y = posy;
_rotation = rot;
}
function getBoundsCenter() {
return([bounds.getCenterX(), bounds.getCenterY()]);
}
function onReleaseItem() {
windUpPendula = undefined;
var _local2 = caught.item;
game.onCaughtItem(_local2);
if (caught == undefined) {
return(undefined);
}
_local2.onAcquire(lastAngle);
caught = undefined;
}
function getBoundBox() {
return(bounds);
}
function reset() {
fallingHook = undefined;
pendula = new midasplayer.goldfishbowl.Pendulum(0.15, 80, MIN_LENGTH);
lastAngle = pendula.angle;
lineLength = MIN_LENGTH;
windingDirection = 0;
windUpPendula = undefined;
if (caught != undefined) {
caught.item.destroy();
caught.shadow.destroy();
caught = undefined;
}
var _local2 = DEGREE_TO_RADIAN * lastAngle;
var _local3 = com.midasplayer.util.SineLookup.__get__instance();
var _local4 = _local3.sin(_local2);
var _local5 = _local3.cos(_local2);
posx = (_local4 * lineLength) + rodx;
posy = (_local5 * lineLength) + rody;
rot = -lastAngle;
bounds = new midasplayer.goldfishbowl.BoundBox(0, 0, 9, 14, 0);
bounds.setPosition(posx + (_local4 * 7), posy + (_local5 * 7), -_local2);
gotoAndStop(1);
hasBigHook = false;
isReleased = false;
hasStrength = false;
}
function hasCatch() {
return(caught != undefined);
}
function getCaughtItem() {
return(caught.item);
}
function getAngle() {
return(DEGREE_TO_RADIAN * pendula.__get__angle());
}
function getLineLength() {
var _local3 = -20;
if (caught != undefined) {
var _local2 = midasplayer.goldfishbowl.TankItem.ITEM[caught.item.getName()];
if (_local2.yoffs != undefined) {
_local3 = _local2.yoffs;
}
}
return(lineLength + _local3);
}
function getDirection() {
return(windingDirection);
}
function canDropHook() {
return(windingDirection == 0);
}
function getStrength() {
return(hasStrength);
}
function setStrength(enable) {
hasStrength = enable;
}
function setBigHook(enable) {
if (enable) {
bounds = new midasplayer.goldfishbowl.BoundBox(0, 0, 32, 22, 0);
hasBigHook = true;
gotoAndStop(2);
} else {
bounds = new midasplayer.goldfishbowl.BoundBox(0, 0, 9, 14, 0);
hasBigHook = false;
gotoAndStop(1);
}
}
function updateAsFalling() {
posy = posy + 15;
}
function getFallingHook() {
return(fallingHook);
}
function attachNewFishingline() {
var _local3 = false;
if (sinkUpdateTimer == undefined) {
var _local2 = parent.getNextHighestDepth();
var _local4 = parent.attachMovie("hook2", "oldhook" + _local2, _local2);
fallingHook = _local4;
fallingHook.gotoAndStop((hasBigHook ? 2 : 1));
fallingHook.posx = posx;
fallingHook.posy = posy;
fallingHook.rot = rot;
fallingHook.lastAngle = lastAngle;
fallingHook.lineLength = lineLength;
fallingHook.rodx = rodx;
fallingHook.rody = rody;
fallingHook.isReleased = true;
fallingHook.creator = this;
fallingHook.tankLeft = tankLeft;
fallingHook.tankTop = tankTop;
fallingHook.tankRight = tankRight;
fallingHook.tankBottom = tankBottom;
fallingHook.caught = caught;
caught.item.setDepth(parent.getNextHighestDepth());
lineLength = MIN_LENGTH;
windingDirection = 0;
caught = undefined;
windUpPendula = undefined;
sinkUpdateTimer = setInterval(mx.utils.Delegate.create(fallingHook, updateAsFalling), 25);
_local3 = true;
}
return(_local3);
}
function releaseHook() {
var _local2;
if (canDropHook()) {
windingDirection = 1;
_local2 = pendula.__get__state().concat([dropSpeed]);
reelSlowdown = 50;
}
return(_local2);
}
function retractHook(caught) {
if (caught != undefined) {
caught.item.setDepth(parent.getNextHighestDepth());
grabX = caught.item.getPosX() - posx;
grabY = caught.item.getPosY() - posy;
this.caught = caught;
}
windingDirection = -1;
windUpPendula = new midasplayer.goldfishbowl.Pendulum(8.5, lastAngle, lineLength);
game.onReelIn(caught.item);
}
static var RADIAN_TO_DEGREE = 57.2957795;
static var DEGREE_TO_RADIAN = 0.0174532925;
static var MIN_LENGTH = 60;
}
Symbol 435 MovieClip [__Packages.midasplayer.goldfishbowl.Pendulum] Frame 0
class midasplayer.goldfishbowl.Pendulum
{
var tickCount, ad, ad1, ad2, ad3, ad4, alfa, tf, grlan;
function Pendulum (timeFactor, a, b) {
if ((STAB == undefined) || (STAB.length == 0)) {
STAB = new Array(LUTLEN);
var _local2 = 0;
while (_local2 < LUTLEN) {
STAB[_local2] = -Math.sin(_local2 * CO);
_local2++;
}
}
tickCount = 0;
ad = [0, 0];
ad1 = [0, 0];
ad2 = [0, 0];
ad3 = [0, 0];
ad4 = [0, 0];
alfa = [0, 0];
tf = timeFactor;
alfa[0] = (a * Math.PI) / 180;
grlan = (-grav) / b;
}
function derivs(fad, fad1) {
fad1[0] = fad[1];
var _local3 = ((fad[0] * ICO) + LUTLEN2) >> 0;
fad1[1] = (grlan * STAB[_local3]) * tf;
return(fad1);
}
function rk4(ad, ad1) {
ad4[0] = ad[0] + (d1 * ad1[0]);
ad4[1] = ad[1] + (d1 * ad1[1]);
ad3[0] = ad4[1];
var _local3 = ((ad4[0] * ICO) + LUTLEN2) >> 0;
ad3[1] = (grlan * STAB[_local3]) * tf;
ad4[0] = ad[0] + (d1 * ad3[0]);
ad4[1] = ad[1] + (d1 * ad3[1]);
ad2[0] = ad4[1];
_local3 = ((ad4[0] * ICO) + LUTLEN2) >> 0;
ad2[1] = (grlan * STAB[_local3]) * tf;
ad4[0] = ad[0] + (dt * ad2[0]);
ad2[0] = ad2[0] + ad3[0];
ad4[1] = ad[1] + (dt * ad2[1]);
ad2[1] = ad2[1] + ad3[1];
ad3[0] = ad4[1];
_local3 = ((ad4[0] * ICO) + LUTLEN2) >> 0;
ad3[1] = (grlan * STAB[_local3]) * tf;
ad[0] = ad[0] + (d2 * ((ad1[0] + ad3[0]) + (2 * ad2[0])));
ad[1] = ad[1] + (d2 * ((ad1[1] + ad3[1]) + (2 * ad2[1])));
return(ad);
}
function update(skipTick) {
alfa = rk4(alfa, derivs(alfa, ad));
if (!skipTick) {
tickCount++;
}
}
function get state() {
return([tickCount, alfa[0]]);
}
function get tick() {
return(tickCount);
}
function get angle() {
return(alfa[0] * 57.2957795);
}
function get radians() {
return(alfa[0]);
}
static var grav = 9.81;
static var bt = 2;
static var LUTLEN = 16384;
static var LUTLEN2 = LUTLEN / 2;
static var CO = (Math.PI*2) / LUTLEN;
static var ICO = 1 / CO;
static var STAB = undefined;
static var dt = 0.2;
static var d1 = dt * 0.5;
static var d2 = dt / 6;
}
Symbol 436 MovieClip [__Packages.com.midasplayer.fx.TextBox] Frame 0
class com.midasplayer.fx.TextBox
{
var fontResource, align, width, height, chars, staticClips, clips, charOrder, mc, offsetX, offsetY, minWidth, flapping, lastMsg;
function TextBox (resourceName, order, ox, oy, w, h, alignment, dest) {
fontResource = resourceName;
align = alignment.toLowerCase();
width = w;
height = h;
chars = new Array();
staticClips = new Array();
clips = new Array();
charOrder = order;
mc = dest;
offsetX = ox;
offsetY = oy;
minWidth = 10;
flapping = false;
}
function setOldSchoolAirPortFlapping(enable) {
flapping = enable;
}
function addStaticMc(mc) {
staticClips.push(mc);
}
function setText(newMsg, force) {
if ((newMsg == lastMsg) && (!force)) {
return(undefined);
}
lastMsg = newMsg;
var _local5 = chars;
chars = new Array();
var _local17 = newMsg.length;
var _local3 = 0;
while (_local3 < _local17) {
var _local9 = newMsg.charAt(_local3);
switch (_local9) {
case newline :
case " " :
chars[_local3] = 0;
}
var _local6 = charOrder.indexOf(_local9);
if (_local6 < 0) {
} else {
_local6++;
chars[_local3] = _local6;
}
_local3++;
}
var _local2;
var _local4 = 0;
var _local15 = 0;
var _local14 = 0;
var _local11 = function () {
if (this._currentframe != this.targetFrame) {
var _local2 = this._currentframe;
this.nextFrame();
var _local3 = this._currentframe;
if ((_local3 == _local2) && (this._currentframe == this._totalframes)) {
this.gotoAndStop(1);
}
}
};
if (staticClips.length > 0) {
_local3 = 0;
while ((_local3 < chars.length) && (_local14 < staticClips.length)) {
_local2 = undefined;
if (chars[_local3] > 0) {
_local2 = staticClips[_local14++];
if (flapping) {
var _local10 = _local5[_local3];
if (_local5[_local3] != chars[_local3]) {
_local10 = (chars[_local3] + 1) % _local2._totalframes;
}
_local2.targetFrame = chars[_local3];
_local2.gotoAndStop(_local10);
_local2.onEnterFrame = _local11;
} else {
_local2.gotoAndStop(chars[_local3]);
}
}
_local3++;
}
return(undefined);
}
for (_local3 in clips) {
clips[_local3].swapDepths(1048000);
clips[_local3].removeMovieClip();
}
clips = new Array();
if ((align == "center") || (align == "right")) {
var _local13 = 0;
_local3 = 0;
while (_local3 < chars.length) {
_local2 = undefined;
if (chars[_local3] > 0) {
var _local7 = com.midasplayer.util.DepthSequencer.nextValue();
var _local12 = (fontResource + "-") + _local7;
_local2 = mc.attachMovie(fontResource, _local12, _local7);
_local2._visible = false;
_local2._x = offsetX;
_local2._y = offsetY;
clips.push(_local2);
if (flapping) {
var _local10 = _local5[_local3];
if (_local5[_local3] != chars[_local3]) {
_local10 = (chars[_local3] + 1) % _local2._totalframes;
}
_local2.targetFrame = chars[_local3];
_local2.gotoAndStop(_local10);
_local2.onEnterFrame = _local11;
} else {
_local2.gotoAndStop(chars[_local3]);
}
_local13 = _local13 + ((fixedWidth < 0) ? (Math.max(_local2._width, minWidth)) : (fixedWidth));
} else {
_local13 = _local13 + space;
}
_local3++;
}
_local14 = 0;
if (align == "right") {
_local4 = width - _local13;
}
if (align == "center") {
_local4 = (width - _local13) / 2;
}
_local3 = 0;
var _local8 = 0;
while (_local3 < chars.length) {
if (chars[_local3] > 0) {
_local2 = clips[_local3 - _local8];
_local2._x = offsetX + _local4;
_local2._y = offsetY + _local15;
_local2._visible = true;
_local4 = _local4 + ((fixedWidth < 0) ? (Math.max(_local2._width, minWidth)) : (fixedWidth));
} else {
_local4 = _local4 + space;
_local8++;
}
_local3++;
}
} else {
_local3 = 0;
while (_local3 < chars.length) {
_local2 = undefined;
if (chars[_local3] > 0) {
var _local7 = com.midasplayer.util.DepthSequencer.nextValue();
var _local12 = (fontResource + "-") + _local7;
_local2 = mc.attachMovie(fontResource, _local12, _local7);
_local2._x = offsetX + _local4;
_local2._y = offsetY + _local15;
clips.push(_local2);
if (flapping) {
var _local10 = _local5[_local3];
if (_local5[_local3] != chars[_local3]) {
_local10 = (chars[_local3] + 1) % _local2._totalframes;
}
_local2.targetFrame = chars[_local3];
_local2.gotoAndStop(_local10);
_local2.onEnterFrame = _local11;
} else {
_local2.gotoAndStop(chars[_local3]);
}
_local4 = _local4 + ((fixedWidth < 0) ? (Math.max(_local2._width, minWidth)) : (fixedWidth));
} else {
_local4 = _local4 + space;
}
_local3++;
}
}
}
function setFixedWidth(pt) {
fixedWidth = pt;
}
function setSpaceWidth(pt) {
space = pt;
}
function setVisible(visible) {
for (var _local2 in clips) {
clips[_local2]._visible = visible;
}
}
function getMovieClip() {
return(mc);
}
static var DEFAULT_SPACE_WIDTH = 8;
var fixedWidth = -1;
var space = DEFAULT_SPACE_WIDTH;
}
Symbol 437 MovieClip [__Packages.com.midasplayer.util.DepthSequencer] Frame 0
class com.midasplayer.util.DepthSequencer
{
function DepthSequencer () {
}
static function nextValue() {
return(++value);
}
static var value = 0;
}
Symbol 438 MovieClip [__Packages.midasplayer.goldfishbowl.Fisherman] Frame 0
class midasplayer.goldfishbowl.Fisherman extends MovieClip
{
var isSitUp, headSway, gender, _visible, ready, tx, ty, _x, _y, headCallback, head, head_holder, bikini, tipX, joint, tipY, _totalframes, gotoAndStop;
function Fisherman () {
super();
isSitUp = false;
headSway = 0;
gender = 1;
_visible = false;
ready = false;
}
function setGender(g) {
gender = g;
}
function setPosition(x, y) {
tx = x;
ty = y;
_x = 500;
_y = y - 200;
anim = new com.midasplayer.util.EaseInQuadAnimator(this);
anim.setPosition(tx, ty);
anim.setDuration(800);
}
function setVisible(enable) {
_visible = enable;
}
function assignHead(headId, offsetX, offsetY, fnCallback) {
headCallback = fnCallback;
head.removeMovieClip();
if (headId < 0) {
head = head_holder.attachMovie("default_head", "head", 1);
} else {
head = head_holder.attachMovie("gubbar", "head", 1);
head._xscale = midasplayer.goldfishbowl.HeadSelector.SCALE;
head._yscale = midasplayer.goldfishbowl.HeadSelector.SCALE;
head.gotoAndStop(headId);
}
if (gender == 1) {
bikini._visible = false;
}
headCallback(null);
headCallback = null;
_visible = true;
}
function sitUp() {
isSitUp = true;
}
function reelIn(weight) {
}
function idle() {
}
function update(hook) {
tipX = _x + joint._x;
tipY = _y + joint._y;
var _local2 = Math.atan2(tipY - hook.posy, tipX - hook.posx);
var _local6 = Math.cos(-_local2) * 44;
var _local5 = (-Math.sin(-_local2)) * 44;
tipX = tipX - _local6;
tipY = tipY - _local5;
var _local3 = -0.174885431730257;
var _local7 = -2.96739513389088;
var _local8 = _local3 - _local7;
_local2 = _local2 - _local3;
_local2 = _local2 / _local8;
head_holder._rotation = ((Math.sin(headSway) * 0.12) * 180) / Math.PI;
headSway = headSway + 0.1;
var _local4 = int((-_local2) * _totalframes) + 1;
gotoAndStop(_local4);
}
function setState(n) {
}
function onEnterFrame() {
if (isSitUp) {
if ((anim != undefined) && (anim.update())) {
ready = true;
anim = undefined;
}
}
}
}
Symbol 439 MovieClip [__Packages.midasplayer.goldfishbowl.HeadSelector] Frame 0
class midasplayer.goldfishbowl.HeadSelector extends MovieClip
{
var leaveAt, sway, selected, heads, getNextHighestDepth, attachMovie, onRollOver, onRollOut, onPress, removeAnim, callback, swayClip, housemate_title, removeMovieClip, leaving_txt;
function HeadSelector () {
super();
leaveAt = 1048576 /* 0x100000 */;
sway = 0;
selected = false;
heads = [];
}
function addHead(name, head, isMale, row, col) {
var _local4 = getNextHighestDepth();
var _local2 = attachMovie("housemate_box", "box" + _local4, _local4);
_local2._xscale = 75;
_local2._yscale = 75;
_local2._x = 72 + ((col * 130) * 0.75);
_local2._y = 103 + ((row * 126) * 0.75);
_local2.name_txt.text = name;
var _local3 = _local2.container.attachMovie("gubbar", "bubbe", 1);
_local3._xscale = SCALE;
_local3._yscale = SCALE;
_local3._x = 42;
_local3._y = 72;
_local3.gotoAndStop(head);
var self = this;
_local2.onRollOver = function () {
self.setHover(true, this);
};
_local2.onRollOut = function () {
self.setHover(false, this);
};
_local2.onPress = function () {
self.selectHead(head, isMale);
};
heads.push([head, isMale]);
}
function selectHead(id, isMale) {
onRollOver = null;
onRollOut = null;
onPress = null;
selected = true;
com.midasplayer.fx.SoundManager.stop("ingame_loop");
removeAnim = new com.midasplayer.util.EaseInQuadAnimator(this);
removeAnim.setPosition(0, 800);
removeAnim.setDuration(750);
callback(id, isMale);
}
function setHover(enable, clip) {
if (enable) {
sway = 0;
swayClip = clip;
} else {
swayClip.bkg._xscale = 100;
swayClip.bkg._yscale = 100;
swayClip.bubbe._rotation = 0;
swayClip = null;
}
}
function init(completeFn) {
callback = completeFn;
var _local2 = 1;
housemate_title.text = com.midasplayer.util.I18n.getString("bigbrother_select_title");
addHead("ALEXANDRA", _local2++, false, 0, 0);
addHead("DALE", _local2++, true, 0, 5);
addHead("DARNELL", _local2++, true, 1, 0);
addHead("DENNIS", _local2++, true, 1, 1);
addHead("JENNIFER", _local2++, false, 1, 2);
addHead("KATHREYA", _local2++, false, 1, 3);
addHead("LISA", _local2++, false, 1, 4);
addHead("LUKE", _local2++, true, 1, 5);
addHead("MARIO", _local2++, true, 2, 0);
addHead("MICHAEL", _local2++, true, 2, 1);
addHead("MOHAMMAD", _local2++, true, 2, 2);
addHead("RACHEL", _local2++, false, 2, 3);
addHead("REBECCA", _local2++, false, 2, 4);
addHead("REX", _local2++, true, 2, 5);
addHead("STEPHANIE", _local2++, false, 3, 0);
addHead("STUART", _local2++, true, 3, 1);
addHead("SYLVIA", _local2++, false, 3, 2);
leaveAt = getTimer() + 15000;
com.midasplayer.fx.SoundManager.play("ingame_loop", 33, true);
}
function onEnterFrame() {
if ((removeAnim != undefined) && (removeAnim.update())) {
removeAnim = undefined;
removeMovieClip();
return(undefined);
}
var _local4 = Math.max(0, int(Math.floor((leaveAt - getTimer()) / 1000)));
if ((!selected) && (_local4 == 0)) {
var _local3 = int(Math.random() * 4096) % heads.length;
selectHead(heads[_local3][0], heads[_local3][1]);
}
leaving_txt.text = com.midasplayer.util.I18n.getString("count_down_text", _local4);
if (swayClip != null) {
var _local2 = (Math.sin(sway) * 20) + 100;
swayClip.bkg._xscale = _local2;
swayClip.bkg._yscale = _local2;
swayClip.bubbe._rotation = ((Math.sin(sway * 0.34) * 180) / Math.PI) * 0.1;
sway = sway + 0.099;
}
}
static var SCALE = 90;
}
Symbol 440 MovieClip [__Packages.com.midasplayer.fx.SoundManager] Frame 0
class com.midasplayer.fx.SoundManager
{
static var preloadLastId, progressCallback, preloadList, preloadNum, preloadLast, beginLoadCallback;
function SoundManager () {
}
static function setup(useClip) {
m_placeholder = useClip;
}
static function isSoundEnabled() {
return(soundEnabled);
}
static function enableSounds(enabled) {
soundEnabled = enabled;
if (!enabled) {
muteAll();
} else {
restoreMuteAll();
}
}
static function stopAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.stop();
soundEntry.playStatus = false;
});
}
static function muteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(0);
soundEntry.isMuted = true;
});
}
static function restoreMuteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(soundEntry.realVol);
soundEntry.isMuted = false;
});
}
static function stop(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
_local1.sound.stop();
_local1.playStatus = false;
}
}
static function getCalibratedVolume(flashVolume) {
flashVolume = Math.min(100, flashVolume);
flashVolume = Math.max(0, flashVolume);
return(Math.ceil(Math.pow(flashVolume / 100, 1.46) * 100));
}
static function setVolume(resource, percent) {
var _local1 = sounds.get(resource);
if ((_local1 != undefined) && (_local1.playStatus == true)) {
if (!_local1.isMuted) {
_local1.sound.setVolume(percent);
}
_local1.realVol = percent;
}
}
static function getPosition(resource) {
var _local1 = sounds.get(resource);
if ((_local1 != undefined) && (_local1.playStatus == true)) {
return(_local1.sound.position);
}
return(-1);
}
static function getLength(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
return(_local1.sound.duration);
}
return(-1);
}
static function isPlaying(resource) {
var _local1 = sounds.get(resource);
return((_local1 != undefined) && (_local1.playStatus == true));
}
static function initialize(list) {
for (var _local8 in list) {
var resource = list[_local8];
var _local2 = m_placeholder.getNextHighestDepth();
var _local1 = new Sound(m_placeholder.createEmptyMovieClip("sm_sndhold_" + _local2, _local2));
_local1.attachSound(resource);
_local1.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
};
sounds.put(resource, {realVol:100, sound:_local1, playStatus:false});
}
}
static function killPreload() {
unload(preloadLastId);
progressCallback = undefined;
preloadLastId = undefined;
preloadList = undefined;
preloadNum = 0;
preloadLast = undefined;
}
static function preload(urlList, fnProgressCallback, fnBeginLoadCallback) {
beginLoadCallback = fnBeginLoadCallback;
progressCallback = fnProgressCallback;
preloadList = new Array();
for (var _local2 in urlList) {
preloadList.push(urlList[_local2]);
}
preloadLast = "";
preloadNum = urlList.length;
loadUrl_();
}
static function unload(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.runtime == true)) {
var _local2 = m_placeholder[_local1.clipId];
_local2.removeMovieClip();
delete _local1.sound;
_local1.sound = undefined;
sounds.remove(name);
}
}
static function setPlaceholderParent(p) {
m_placeholder = p;
}
static function play(resource, volume, isLoop, fn) {
if (volume == undefined) {
volume = 100;
}
if (isLoop == undefined) {
isLoop = false;
}
volume = getCalibratedVolume(volume);
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
_local1.sound.setVolume((soundEnabled ? (volume) : 0));
_local1.realVol = volume;
_local1.isMuted = !soundEnabled;
_local1.playStatus = true;
_local1.onPlayedFn = fn;
_local1.sound.start(0, (isLoop ? 65535 : 1));
} else {
var _local5 = m_placeholder.getNextHighestDepth();
var _local3 = new Sound(m_placeholder.createEmptyMovieClip("sm_sndhold_" + _local5, _local5));
_local3.attachSound(resource);
_local3.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
com.midasplayer.fx.SoundManager.onPlayed_(resource);
};
_local3.setVolume((soundEnabled ? (volume) : 0));
_local3.start(0, (isLoop ? 65535 : 1));
sounds.put(resource, {isMuted:!soundEnabled, realVol:volume, onPlayedFn:fn, sound:_local3, playStatus:true});
}
}
static function onPlayed_(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.onPlayedFn != undefined)) {
_local1.onPlayedFn();
}
}
static function loadUrl_(success) {
var _local8 = preloadNum - preloadList.length;
if (_local8 != 0) {
if (success == false) {
}
progressCallback(_local8, success);
}
if (preloadList.length == 0) {
progressCallback = undefined;
preloadList = undefined;
preloadNum = 0;
preloadLast = undefined;
return(undefined);
}
var _local5 = preloadList.pop();
preloadLast = _local5.url;
var nextId = _local5.id;
if (!_local5.id) {
var _local3 = preloadLast.lastIndexOf("/");
if (_local3 == -1) {
_local3 = 0;
} else {
_local3++;
}
var _local4 = preloadLast.lastIndexOf(".");
if (_local4 == -1) {
_local4 = preloadLast.length;
}
nextId = preloadLast.substring(_local3, _local4);
}
var _local7 = m_placeholder.getNextHighestDepth();
var _local6 = "dn_sndhold_" + _local7;
var _local2 = new Sound(m_placeholder.createEmptyMovieClip(_local6, _local7));
_local2.onLoad = function (a) {
var _local2 = com.midasplayer.fx.SoundManager.loadUrl_;
com.midasplayer.util.Delay.oneShot(this, _local2, 50, a);
};
_local2.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(nextId);
_local1.playStatus = false;
com.midasplayer.fx.SoundManager.onPlayed_(nextId);
};
preloadLastId = nextId;
_local2.loadSound("" + preloadLast, false);
sounds.put(nextId, {realVol:100, clipId:_local6, sound:_local2, playStatus:false, runtime:true});
if (beginLoadCallback) {
beginLoadCallback(_local2, preloadLast, nextId, (preloadNum - preloadList.length) - 1);
}
}
static var m_placeholder = _root;
static var sounds = new com.midasplayer.util.Map();
static var soundEnabled = true;
}
Symbol 441 MovieClip [__Packages.com.midasplayer.util.Delay] Frame 0
class com.midasplayer.util.Delay
{
var m_fn, m_param, m_context, m_delay, m_started, m_timerId;
function Delay (context, fn, delay) {
m_fn = fn;
m_param = new Array();
var _local3 = 3;
while (_local3 < arguments.length) {
m_param.push(arguments[_local3]);
_local3++;
}
m_context = context;
m_delay = delay;
m_started = getTimer();
m_timerId = setInterval(mx.utils.Delegate.create(this, onEvent), delay);
}
function onEvent() {
if (getTimer() >= (m_delay + m_started)) {
clearInterval(m_timerId);
m_fn.apply(m_context, m_param);
m_fn = undefined;
m_param = undefined;
}
}
static function oneShot(context, fn, delay) {
var _local3 = new com.midasplayer.util.Delay(context, fn, delay);
_local3.m_param = new Array();
var _local2 = 3;
while (_local2 < arguments.length) {
_local3.m_param.push(arguments[_local2]);
_local2++;
}
}
}
Symbol 442 MovieClip [__Packages.midasplayer.goldfishbowl.LevelParser] Frame 0
class midasplayer.goldfishbowl.LevelParser
{
var objMgr, parent, random, levelIds, tankLimits, levels, tickOffsets, treasureItems, displacement, nextTreasureItem;
function LevelParser (parent, objMgr, random, tankLimits, levelXml, levelIds) {
this.objMgr = objMgr;
this.parent = parent;
this.random = random;
this.levelIds = levelIds;
this.tankLimits = tankLimits;
var _local35 = {};
levels = new com.midasplayer.util.Map();
tickOffsets = new Array();
treasureItems = new Array();
displacement = new com.midasplayer.util.Map();
nextTreasureItem = 0;
var _local21 = 0;
while (_local21 < 8) {
tickOffsets.push(Math.floor(random.nextFloat() * 150));
_local21++;
}
_local21 = 0;
while (_local21 < 20) {
var _local34 = Math.floor(random.nextFloat() * 3);
treasureItems.push(_local34);
_local21++;
}
var _local6 = 0;
while (_local6 < midasplayer.goldfishbowl.TankItem.ITEMLIST.length) {
var _local26 = midasplayer.goldfishbowl.TankItem.ITEMLIST[_local6];
var _local8 = midasplayer.goldfishbowl.TankItem.ITEM[_local26];
var _local28 = _local8.dx;
var _local27 = _local8.dy;
var _local31 = _local8.dx / 2;
var _local30 = _local8.dy / 2;
var _local10 = new Array(10);
_local21 = 0;
var _local20 = _local10.length;
while (_local21 < _local20) {
var _local14 = Math.round(((random.nextFloat() * _local28) - _local31) * 10);
var _local13 = Math.round(((random.nextFloat() * _local27) - _local30) * 10);
_local10[_local21] = [_local14 / 10, _local13 / 10];
_local21++;
}
displacement.put(_local26, {ptr:0, values:_local10});
_local6++;
}
var _local20 = 0;
while (_local20 < levelXml.length) {
var _local15 = levelXml[_local20].firstChild;
var _local11 = parseInt(levelXml[_local20].attributes.id);
var _local37 = new Array();
for (_local21 in _local15.childNodes) {
var _local4 = _local15.childNodes[_local21];
if (!(_local4.nodeName === "objects")) {
} else {
var _local7 = 0;
for (_local6 in _local4.childNodes) {
var _local2 = _local4.childNodes[_local6];
var _local3 = new Object();
for (var _local29 in _local2.attributes) {
_local3[_local29] = _local2.attributes[_local29];
}
_local37.push({id:nameToId(_local2.nodeName), sval:Math.round((parseFloat(_local3.x) + parseFloat(_local3.y)) * 10000), unique:(_local2.nodeName + "_") + _local7, object:_local3});
_local7++;
}
}
}
_local21 = 0;
while (_local21 < _local37.length) {
_local6 = 0;
while (_local6 < _local37.length) {
if (_local37[_local21].sval <= _local37[_local6].sval) {
var _local8 = _local37[_local6];
_local37[_local6] = _local37[_local21];
_local37[_local21] = _local8;
}
_local6++;
}
_local21++;
}
_local35["@" + _local11] = _local37;
_local20++;
}
_local21 = 0;
while (_local21 < levelIds.length) {
var _local9 = _local35["@" + levelIds[_local21]];
var _local25 = new com.midasplayer.util.Map();
var _local23 = new com.midasplayer.util.Map();
var _local24 = new com.midasplayer.util.Map();
_local6 = 0;
while (_local6 < _local9.length) {
var _local5 = _local9[_local6].unique;
_local25.put(_local5, _local9[_local6].object);
var _local18 = getDisplacementByName(_local5.split("_")[0]);
_local23.put(_local5, _local18);
var _local22 = TREASURE_ITEM[treasureItems[nextTreasureItem % treasureItems.length]];
nextTreasureItem++;
_local24.put(_local5, _local22);
_local6++;
}
levels.put("@" + levelIds[_local21], {objects:_local25, treasure:_local24, displacement:_local23});
_local21++;
}
}
function nameToId(name) {
var _local1 = 0;
while (_local1 < midasplayer.goldfishbowl.TankItem.ITEMLIST.length) {
if (midasplayer.goldfishbowl.TankItem.ITEMLIST[_local1] == name) {
return(_local1);
}
_local1++;
}
return(-1);
}
function initLevelByNumber(levelId) {
var _local2 = levels.get("@" + levelIds[levelId]);
var _local3 = _local2.objects;
_local3.foreach(mx.utils.Delegate.create(this, everyObject), _local2.displacement, _local2.treasure);
return(_local3);
}
function getHookOffsetByLevel(levelId) {
return(tickOffsets[levelId % tickOffsets.length]);
}
function everyObject(key, value, disp, treasure) {
var _local2 = disp.get(key);
var _local5 = treasure.get(key);
var _local3 = attachTankItemEx(key, value, _local2[0], _local2[1], _local5);
_local3.setAlpha(0);
}
function createTankItem(name, x, y, rotation, treasure) {
var _local2;
switch (name) {
case "fish" :
case "diamondfish" :
_local2 = new midasplayer.goldfishbowl.Fish(objMgr, name, x, y, parent.tank);
_local2.setImmedateRendering(false);
break;
case "fish2" :
_local2 = new midasplayer.goldfishbowl.BigFish(objMgr, name, x, y, parent.tank);
_local2.setImmedateRendering(false);
break;
case "sturgeon" :
_local2 = new midasplayer.goldfishbowl.Sturgeon(objMgr, x, y, parent.tank, 250);
_local2.setImmedateRendering(false);
break;
case "mine" :
_local2 = new midasplayer.goldfishbowl.Mine(objMgr, x, y, parent.tank);
break;
case "treasure" :
_local2 = new midasplayer.goldfishbowl.Treasure(objMgr, x, y, parent.tank, treasure);
break;
default :
_local2 = new midasplayer.goldfishbowl.TankItem(objMgr, name, x, y, parent.tank);
}
_local2.setTankLimits(0, 0, tankLimits.w, tankLimits.h);
return(_local2);
}
function getDisplacementByName(itemName) {
var _local2 = displacement.get(itemName);
return(_local2.values[((++_local2.ptr) - 1) % _local2.values.length]);
}
function attachTankItemEx(key, value, dx, dy, treasure) {
var _local7 = key.split("_")[0];
var _local8 = midasplayer.goldfishbowl.TankItem.ITEM[_local7];
if (_local8 == undefined) {
_local8 = midasplayer.goldfishbowl.TankItem.ITEM.none;
}
var _local6 = parseFloat(value.x) + dx;
var _local5 = parseFloat(value.y) + dy;
var _local4 = parseFloat(value.rotation);
var _local3 = createTankItem(_local7, _local6, _local5, _local4, treasure);
_local6 = _local3.getPosX();
_local5 = _local3.getPosY();
_local3.uniqeId = key;
value.bounds = new midasplayer.goldfishbowl.BoundBox(0, 0, _local3.getWidth(), _local3.getHeight(), 0);
value.bounds.setPosition(_local6, _local5, _local4 * DEGREE_TO_RADIAN);
_local3.setAttribute("bounds", value.bounds);
value.item = _local3;
value.item.setRotation(_local4);
if (value.flip == "true") {
value.item.getMovieClip()._yscale = -100;
}
return(value.item);
}
function attachTankItem(key, value, dx, dy) {
return(attachTankItemEx(key, value, dx, dy, ""));
}
static var DEGREE_TO_RADIAN = 0.0174532925;
static var TREASURE_ITEM = ["strength_item", "doublehook_item", "fishingline_item"];
}
Symbol 443 MovieClip [__Packages.midasplayer.goldfishbowl.Fish] Frame 0
class midasplayer.goldfishbowl.Fish extends midasplayer.goldfishbowl.TankItem
{
var timeCaught, isDead, frame, posY, setItemPosition, posX, setRotation, deadAngle, tickCount, objMgr, r, tankBottom, tankTop, tankLeft, tankRight, flip, mc, flipState;
function Fish (mgr, fishName, x, y, p) {
super(mgr, fishName, x, y, p);
timeCaught = 0;
isDead = false;
frame = 0;
}
function update() {
if (isDead) {
if (posY > 20) {
setItemPosition(posX, posY - 2);
setRotation((deadAngle = deadAngle + 1));
tickCount++;
} else {
objMgr.removeTankItem(this);
}
return(undefined);
}
var _local2 = (r + 90) * midasplayer.goldfishbowl.TankItem.DEGREE_TO_RADIAN;
var _local3 = com.midasplayer.util.SineLookup.__get__instance();
var _local5 = _local3.sin(_local2) * 2;
var _local4 = (-_local3.cos(_local2)) * 2;
setItemPosition(posX + _local5, posY + _local4);
var _local6 = (posY > (tankBottom - 80)) || (posY < (tankTop + 20));
var _local7 = (posX < (tankLeft + 20)) || (posX > (tankRight - 20));
if (_local6 || (_local7)) {
flip();
}
var _local8 = (int(frame) % mc.rat.inner._totalframes) + 1;
mc.rat.inner.gotoAndStop(_local8);
frame = frame + 0.4;
tickCount++;
}
function onCatch() {
if (isDead) {
return(false);
}
if (flipState) {
flip();
}
return(true);
}
function updateCaught(hx, hy, ha) {
if (isDead) {
return(undefined);
}
var _local2 = com.midasplayer.util.SineLookup.__get__instance();
ha = ha + (_local2.sin(timeCaught) * (_local2.sin(2.5 + (timeCaught / 1.5)) * 35));
hx = hx + ((Math.random() * 4) - 2);
hy = hy + ((Math.random() * 4) - 2);
timeCaught = timeCaught + 0.76;
setItemPosition(hx, hy);
setRotation(ha - 90);
}
}
Symbol 444 MovieClip [__Packages.midasplayer.goldfishbowl.BigFish] Frame 0
class midasplayer.goldfishbowl.BigFish extends midasplayer.goldfishbowl.Fish
{
var frame, isDead, setItemPosition, posX, posY, r, tankBottom, tankTop, tankLeft, tankRight, flip, tickCount, mc;
function BigFish (mgr, fishName, x, y, p) {
super(mgr, fishName, x, y, p);
frame = 1;
}
function update() {
if (isDead) {
setItemPosition(posX, posY);
return(undefined);
}
var _local2 = (r + 90) * midasplayer.goldfishbowl.TankItem.DEGREE_TO_RADIAN;
var _local3 = com.midasplayer.util.SineLookup.__get__instance();
var _local5 = _local3.sin(_local2) * 2;
var _local4 = (-_local3.cos(_local2)) * 2;
setItemPosition(posX + _local5, posY + _local4);
var _local6 = (posY > (tankBottom - 80)) || (posY < (tankTop + 20));
var _local7 = (posX < (tankLeft - 20)) || (posX > (tankRight - 20));
if (_local6 || (_local7)) {
flip();
}
tickCount++;
var _local8 = (int(frame) % mc.bee._totalframes) + 1;
mc.bee.gotoAndStop(_local8);
frame++;
}
}
Symbol 445 MovieClip [__Packages.midasplayer.goldfishbowl.Sturgeon] Frame 0
class midasplayer.goldfishbowl.Sturgeon extends midasplayer.goldfishbowl.TankItem
{
var appearTime, timeCaught, isDead, hasAppeared, noFlip, turnCount, distance, tickCount, setItemPosition, posX, posY, distort, px, py, r, tankBottom, tankTop, tankLeft, tankRight, flip, removeAt, objMgr, setPosition, setRotation;
function Sturgeon (objMgr, x, y, p, appearAfter) {
super(objMgr, "sturgeon", ((x > 330) ? 800 : -150), y, p);
appearTime = appearAfter;
timeCaught = 0;
isDead = false;
hasAppeared = false;
noFlip = false;
turnCount = 0;
distance = 0;
}
function update() {
tickCount++;
if (isDead || (tickCount < appearTime)) {
setItemPosition(posX, posY);
return(undefined);
}
if (!hasAppeared) {
if (!com.midasplayer.fx.SoundManager.isPlaying("sturgeon_enter")) {
com.midasplayer.fx.SoundManager.play("sturgeon_enter", 75);
}
hasAppeared = true;
}
if (distort != undefined) {
if (distort >= tickCount) {
var _local2 = 10 * ((distort - tickCount) / 15);
var _local6 = _local2 / 2;
setItemPosition(px + ((Math.random() * _local2) - _local6), py + ((Math.random() * _local2) - _local6));
} else {
setItemPosition(px, py);
distort = undefined;
}
} else {
var _local3 = (r + 90) * midasplayer.goldfishbowl.TankItem.DEGREE_TO_RADIAN;
var _local5 = com.midasplayer.util.SineLookup.__get__instance();
var _local4 = _local5.sin(_local3) * 6;
var _local7 = (-_local5.cos(_local3)) * 6;
distance = distance + Math.abs(_local4);
setItemPosition(posX + _local4, posY + _local7);
var _local8 = (posY > (tankBottom - 80)) || (posY < (tankTop + 20));
var _local9 = (posX < (tankLeft - 20)) || (posX > (tankRight - 20));
if ((((!noFlip) && (distance > 400)) && (turnCount < 4)) && (_local8 || (_local9))) {
turnCount++;
flip();
}
if (noFlip && (distance > removeAt)) {
objMgr.removeTankItem(this);
}
if ((!noFlip) && (turnCount >= 4)) {
noFlip = true;
removeAt = distance + 800;
}
}
}
function onCatch() {
if (isDead) {
return(true);
}
distort = tickCount + 15;
px = posX;
py = posY;
objMgr.addTankItem("caviar", px, py);
return(false);
}
function updateCaught(hx, hy, ha) {
if (isDead) {
setPosition(hx, hy);
setRotation(ha - 90);
return(undefined);
}
var _local2 = com.midasplayer.util.SineLookup.__get__instance();
ha = ha + (_local2.sin(timeCaught) * (_local2.sin(2.5 + (timeCaught / 1.5)) * 10));
hx = hx + ((Math.random() * 2) - 1);
hy = hy + ((Math.random() * 2) - 1);
timeCaught = timeCaught + 0.8;
setItemPosition(hx, hy);
setRotation(ha - 90);
}
}
Symbol 446 MovieClip [__Packages.midasplayer.goldfishbowl.Mine] Frame 0
class midasplayer.goldfishbowl.Mine extends midasplayer.goldfishbowl.TankItem
{
var swelling, objMgr, setScale;
function Mine (mgr, x, y, p) {
super(mgr, "mine", x, y, p);
swelling = (Math.random() * 2) * Math.PI;
}
function onCatch() {
chainReactionBy(this);
return(false);
}
function chainReactionBy(item) {
item.exploded = true;
var _local5 = objMgr.getItemsByProximity(item, 100);
var _local3 = 0;
var _local4 = _local5.length;
while (_local3 < _local4) {
var _local2 = _local5[_local3];
if ((_local2.getName() == "mine") && (!_local2.exploded)) {
chainReactionBy(_local2);
} else if (_local2.onBlast()) {
objMgr.blastTankItem(_local2);
}
_local3++;
}
}
function update() {
setScale((Math.sin(swelling) * 10) + 100);
swelling = swelling + 0.0753;
}
}
Symbol 447 MovieClip [__Packages.midasplayer.goldfishbowl.Treasure] Frame 0
class midasplayer.goldfishbowl.Treasure extends midasplayer.goldfishbowl.TankItem
{
var contained, containedSprite, thisParent, mc, objMgr, destroy;
function Treasure (mgr, x, y, p, contained) {
super(mgr, "treasure", x, y, p);
this.contained = contained;
}
function onRevealAnimatonComplete() {
containedSprite.setAlpha(100);
containedSprite.setParent(thisParent);
containedSprite.setRotation(mc._rotation);
containedSprite.setPosition(mc._x, mc._y - MOVE_HEIGHT);
objMgr.bonusItemAcquired(contained, containedSprite);
destroy();
}
function onAcquire(lastAngle) {
containedSprite = new com.midasplayer.util.Sprite(contained, 0, 0, 0, mc);
containedSprite.setAlpha(0);
var _local3 = lastAngle * midasplayer.goldfishbowl.TankItem.DEGREE_TO_RADIAN;
var _local2 = new com.midasplayer.util.EaseInQuadAnimator();
_local2.setPosition(Math.sin(_local3) * MOVE_HEIGHT, (-Math.cos(_local3)) * MOVE_HEIGHT);
_local2.setDuration(500);
containedSprite.applyAnimator(_local2, mx.utils.Delegate.create(this, onRevealAnimatonComplete));
containedSprite.approachAlpha(100, 300);
}
static var MOVE_HEIGHT = 50;
}
Symbol 448 MovieClip [__Packages.com.midasplayer.timing.Timer] Frame 0
class com.midasplayer.timing.Timer
{
var timeable;
function Timer (timeable, gameTicksPerSecond) {
millisPerGameTick = 1000 / gameTicksPerSecond;
this.gameTicksPerSecond = gameTicksPerSecond;
this.timeable = timeable;
maxTickTime = 500;
}
function getMillisPerTick() {
return(millisPerGameTick);
}
function getTicksPerSecond() {
return(gameTicksPerSecond);
}
function setMaxTickTime(millis) {
maxTickTime = millis;
}
function advanceTime2() {
var _local3 = getTimer();
if (startTime < 0) {
startTime = _local3;
unprocessedTime = millisPerGameTick;
}
time = _local3 - startTime;
var _local5 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local5;
if (unprocessedTime >= millisPerGameTick) {
var _local2 = maxTickTime + _local3;
do {
timeable.tick(tick);
tick++;
unprocessedTime = unprocessedTime - millisPerGameTick;
} while ((unprocessedTime >= millisPerGameTick) && (getTimer() < _local2));
}
var _local4 = (unprocessedTime % millisPerGameTick) / millisPerGameTick;
com.midasplayer.timing.IFloat.setAlpha(_local4);
timeable.render(tick, _local4);
}
function advanceTime() {
time = getTimer();
var _local3 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local3;
var _local2 = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = unprocessedTime - millisPerGameTick;
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10) {
unprocessedTime = 0;
}
}
var _local4 = unprocessedTime / millisPerGameTick;
timeable.render(tick, _local4);
}
var time = 0;
var startTime = -1;
var lastTime = 0;
var unprocessedTime = 0;
var gameTicksPerSecond = 0;
var tick = 0;
var millisPerGameTick = 0;
var maxTickTime = -1;
}
Symbol 449 MovieClip [__Packages.midasplayer.goldfishbowl.Plate] Frame 0
class midasplayer.goldfishbowl.Plate extends MovieClip
{
var _visible, self, exitDelay, exitCallback, stopDisplayTime, swapDepths, removeMovieClip;
function Plate () {
super();
_visible = false;
self = this;
exitDelay = -1;
}
function setExitEvent(fn) {
exitCallback = fn;
}
function remove() {
exitDelay = getTimer() + Math.round((Math.random() * 500) + 10);
}
function onEnterFrame() {
var _local5 = getTimer();
var _local3 = stopDisplayTime - _local5;
if (_local3 < 0) {
_local3 = 0;
}
_local3 = _local3 / 1000;
_local3 = Math.ceil(_local3);
var _local6 = this;
_local6.next_level_txt.text = com.midasplayer.util.I18n.getString("count_down_text", _local3);
if ((exitDelay != -1) && (_local5 > exitDelay)) {
if (exitCallback) {
exitCallback(this);
}
for (var _local4 in this) {
var _local2 = this[_local4];
if (typeof(this[_local4]) == "movieclip") {
_local2.swapDepths(1048000);
_local2.removeMovieClip();
}
}
onEnterFrame = undefined;
swapDepths(1048000);
removeMovieClip();
} else if (_local5 > stopDisplayTime) {
remove();
}
}
function onPress() {
remove();
}
}
Symbol 450 MovieClip [__Packages.midasplayer.goldfishbowl.LevelOverPlate] Frame 0
class midasplayer.goldfishbowl.LevelOverPlate extends midasplayer.goldfishbowl.Plate
{
var self, stopDisplayTime, _visible;
function LevelOverPlate () {
super();
}
function init(currentLevel, finalScore, qualifyScore, nextLevelScore) {
self.complete_msg_txt.text = "";
self.qualify_txt.text = com.midasplayer.util.I18n.getString("qualify_score");
self.qualify_number_txt.text = "" + qualifyScore;
self.score_txt.text = com.midasplayer.util.I18n.getString("current_score");
self.score_number_txt.text = "" + finalScore;
var _local2 = 5;
if (qualifyScore <= finalScore) {
self.complete_msg_txt.text = com.midasplayer.util.I18n.getString("level_complete", currentLevel);
self.message_txt.text = com.midasplayer.util.I18n.getString("you_qualified");
if (nextLevelScore != undefined) {
self.next_score_txt.text = com.midasplayer.util.I18n.getString("next_level_qualify");
self.next_score_number_txt.text = "" + nextLevelScore;
}
} else {
self.message_txt.text = com.midasplayer.util.I18n.getString("you_didnt_qualify");
self.message2_txt.text = com.midasplayer.util.I18n.getString("game_over");
_local2 = 10;
}
self.next_level_txt.text = com.midasplayer.util.I18n.getString("count_down_text", _local2);
stopDisplayTime = getTimer() + (_local2 * 1000);
_visible = true;
}
}
Symbol 451 MovieClip [__Packages.midasplayer.goldfishbowl.IntroPlate] Frame 0
class midasplayer.goldfishbowl.IntroPlate extends midasplayer.goldfishbowl.Plate
{
var self, stopDisplayTime, _visible;
function IntroPlate () {
super();
}
function init() {
self.top_txt.text = com.midasplayer.util.I18n.getString("instructions_title");
self.instructions_txt.text = com.midasplayer.util.I18n.getString("instructions_text");
self.title_good_txt.text = com.midasplayer.util.I18n.getString("instructions_title_good");
self.title_bad_txt.text = com.midasplayer.util.I18n.getString("instructions_title_bad");
self.title_special_txt.text = com.midasplayer.util.I18n.getString("instructions_title_special");
self.next_level_txt.text = com.midasplayer.util.I18n.getString("count_down_text", 10);
var _local7 = ["crisps", "cola", "diamondfish", "beans", "sunlotion", "caviar", "korv", "champagne"];
var _local3 = 0;
while (_local3 < _local7.length) {
var _local2 = self.attachMovie(_local7[_local3], "gi" + _local3, self.getNextHighestDepth());
_local2._x = 44 + ((_local3 % 3) * 80);
_local2._y = 190 + (Math.floor(_local3 / 3) * 64);
_local2._yscale = (_local2._xscale = getScale(_local2._width, _local2._height, 40, 40));
var _local4 = self.createEmptyMovieClip("gt" + _local3, self.getNextHighestDepth());
_local4._xscale = 50;
_local4._yscale = 50;
_local4._x = _local2._x - 8;
_local4._y = _local2._y;
var _local5 = new com.midasplayer.fx.TextBox("numbas", numberOrder, 0, 50, 18, 30, "center", _local4);
_local5.setFixedWidth(16);
_local5.setText("" + midasplayer.goldfishbowl.TankItem.ITEM[_local7[_local3]].points);
_local3++;
}
var _local6 = ["briefs", "fish", "smalltire", "fish2", "tire", "mine"];
_local3 = 0;
while (_local3 < _local6.length) {
var _local2 = self.attachMovie(_local6[_local3], "bi" + _local3, self.getNextHighestDepth());
_local2._x = 300 + ((_local3 % 2) * 80);
_local2._y = 190 + (Math.floor(_local3 / 2) * 64);
_local2._yscale = (_local2._xscale = getScale(_local2._width, _local2._height, 40, 40));
var _local4 = self.createEmptyMovieClip("bt" + _local3, self.getNextHighestDepth());
_local4._xscale = 50;
_local4._yscale = 50;
_local4._x = _local2._x - 8;
_local4._y = _local2._y;
var _local5 = new com.midasplayer.fx.TextBox("numbas", numberOrder, 0, 50, 18, 30, "center", _local4);
_local5.setFixedWidth(16);
_local5.setText("" + midasplayer.goldfishbowl.TankItem.ITEM[_local6[_local3]].points);
_local3++;
}
stopDisplayTime = getTimer() + 10000;
_visible = true;
}
function getScale(realWidth, realHeight, maxWidth, maxHeight) {
var _local10 = realWidth;
var _local9 = realHeight;
var _local1 = _local10;
var _local2 = _local9;
if ((_local1 < maxWidth) && (_local2 < maxWidth)) {
_local2 = _local2 * (maxWidth / _local1);
_local1 = maxWidth;
}
if (_local1 > maxWidth) {
_local2 = _local2 * (maxWidth / _local1);
_local1 = maxWidth;
}
if (_local2 > maxHeight) {
_local1 = _local1 * (maxHeight / _local2);
_local2 = maxHeight;
}
var _local7 = 100 * (1 - ((realWidth - _local1) / realWidth));
var _local4 = 100 * (1 - ((realHeight - _local2) / realHeight));
return(Math.min(_local7, _local4));
}
static var numberOrder = "0123456789:x";
}
Symbol 452 MovieClip [__Packages.midasplayer.goldfishbowl.GameOverPlate] Frame 0
class midasplayer.goldfishbowl.GameOverPlate extends midasplayer.goldfishbowl.Plate
{
var self, stopDisplayTime, _visible;
function GameOverPlate () {
super();
}
function init(currentLevel, finalScore) {
self.score_txt.text = com.midasplayer.util.I18n.getString("current_score");
self.score_number_txt.text = "" + finalScore;
self.message_txt.text = com.midasplayer.util.I18n.getString("game_over");
self.next_level_txt.text = com.midasplayer.util.I18n.getString("count_down_text", 10);
stopDisplayTime = getTimer() + 10000;
_visible = true;
}
}