Frame 1
function onGameDataLoaded() {
_root.game = new midasplayer.Pyramini(_root);
_root.game.init(_root.gda);
}
_root.gda = new com.midasplayer.util.GameDataAcquirer();
_root.gda.beginWait(mx.utils.Delegate.create(this, onGameDataLoaded));
Symbol 80 MovieClip [card_2] Frame 1
#initclip 28
Object.registerClass("card_2", midasplayer.Card);
#endinitclip
Symbol 95 MovieClip [numbers] Frame 1
stop();
Symbol 96 MovieClip [digits] Frame 1
#initclip 27
Object.registerClass("digits", midasplayer.ArcadeNumbers);
#endinitclip
Symbol 103 MovieClip Frame 1
stop();
Symbol 104 MovieClip [__Packages.com.midasplayer.timing.Timeable] Frame 0
interface com.midasplayer.timing.Timeable
{
}
Symbol 105 MovieClip [__Packages.midasplayer.MidasGame] Frame 0
class midasplayer.MidasGame implements com.midasplayer.timing.Timeable
{
var parent, mainTimer;
function MidasGame (gameParent) {
var _local3 = new ContextMenu();
_local3.hideBuiltInItems();
_local3.builtInItems.quality = true;
_root.menu = _local3;
Stage.scaleMode = "noScale";
parent = gameParent;
parent.onEnterFrame = mx.utils.Delegate.create(this, drive);
mainTimer = new com.midasplayer.timing.Timer(this, 25);
}
function drive() {
mainTimer.advanceTime();
}
function tick(tick) {
}
function render(tick, alpha) {
}
function init(gda) {
}
function exit() {
}
function quit() {
}
}
Symbol 106 MovieClip [__Packages.com.midasplayer.timing.Timer] Frame 0
class com.midasplayer.timing.Timer
{
var timeable;
function Timer (timeable, gameTicksPerSecond) {
millisPerGameTick = 1000 / gameTicksPerSecond;
this.timeable = timeable;
}
function getMillisPerTick() {
return(millisPerGameTick);
}
function advanceTime() {
time = getTimer();
var _local3 = time - lastTime;
lastTime = time;
fps = 1000 / _local3;
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 lastTime = 0;
var unprocessedTime = 0;
var tick = 0;
var millisPerGameTick = 0;
var fps = 0;
}
Symbol 107 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 108 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 109 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 110 MovieClip [__Packages.com.midasplayer.util.Iterator] Frame 0
interface com.midasplayer.util.Iterator
{
}
Symbol 111 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 112 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 113 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 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 114 MovieClip [__Packages.midasplayer.Game] Frame 0
interface midasplayer.Game
{
}
Symbol 115 MovieClip [__Packages.midasplayer.Card] Frame 0
class midasplayer.Card extends MovieClip
{
var cardInPyramid, cardInDeck, highlightEnable, px, py, fx, fy, currentType, currentSuit, faceVisible, _xscale, _yscale, _visible, highlight, clickListener, startAt, movement, moveSlave, _x, _y, flipAndMove, blockCard1, blockCard2, clickable, gotoAndStop;
function Card () {
super();
cardInPyramid = false;
cardInDeck = true;
highlightEnable = false;
px = 0;
py = 0;
fx = new com.midasplayer.timing.IFloat();
fy = new com.midasplayer.timing.IFloat();
currentType = TYPE_UNKNOWN;
currentSuit = SUIT_UNKNOWN;
faceVisible = false;
_xscale = SCALE;
_yscale = SCALE;
_visible = false;
highlight = highlight;
highlight._visible = false;
clickListener = [];
}
function addClickListener(cl) {
clickListener.push(cl);
}
function fireClickListener() {
for (var _local2 in clickListener) {
clickListener[_local2].onClickCard(this);
}
}
function removeClickListeners() {
clickListener = [];
}
function update(tick) {
if ((startAt != undefined) && (getTimer() > startAt)) {
if (movement && (!movement.isFinished())) {
if (movement.update()) {
movement = undefined;
startAt = undefined;
}
px = moveSlave._x;
py = moveSlave._y;
}
}
fx.set(px);
fy.set(py);
}
function onPress() {
fireClickListener();
}
function setHighlightEnabled(b) {
highlightEnable = b;
if (!b) {
highlight._visible = false;
}
}
function onRollOver() {
if (highlightEnable) {
highlight._visible = true;
}
}
function onRollOut() {
if (highlightEnable) {
highlight._visible = false;
}
}
function onReleaseOutside() {
if (highlightEnable) {
highlight._visible = false;
}
}
function isMoving() {
return((movement != undefined) && (!movement.isFinished()));
}
function render(tick, alpha) {
_x = fx.get(alpha);
_y = fy.get(alpha);
_visible = true;
}
function moveTo(x, y, startDelay, flipOver) {
flipAndMove = flipOver;
startAt = startDelay + getTimer();
if (flipOver) {
showFace();
}
moveSlave = {_x:px, _y:py};
var _local3 = px - x;
var _local2 = py - y;
var _local4 = Math.max(200, Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
movement = new com.midasplayer.util.EaseOutCubicAnimator(moveSlave);
movement.setPosition(x, y);
movement.setDuration(150);
}
function isBlocked() {
if (blockCard1 == null) {
if (blockCard2 == null) {
return(false);
}
if (blockCard2.isCardInPyramid()) {
return(true);
}
return(false);
}
if (blockCard2 == null) {
if (blockCard1 == null) {
return(false);
}
if (blockCard1.isCardInPyramid()) {
return(true);
}
return(false);
}
if (blockCard1.isCardInPyramid() || (blockCard2.isCardInPyramid())) {
return(true);
}
return(false);
}
function setBlockedBy(c1, c2) {
blockCard1 = c1;
blockCard2 = c2;
}
function setCardInDeck(s) {
clickable = false;
cardInDeck = s;
}
function setCardInPyramid(s) {
clickable = false;
cardInPyramid = s;
}
function isCardInDeck() {
return(cardInDeck);
}
function isCardInPyramid() {
return(cardInPyramid);
}
function setPosition(x, y, immedate) {
px = x;
py = y;
if (immedate) {
fx.set(px);
fy.set(py);
}
}
function isFaceVisible() {
return(faceVisible);
}
function showFace() {
if (!faceVisible) {
gotoAndStop((1 + ((currentSuit >> 1) * 13)) + currentType);
faceVisible = true;
}
}
function setKind(suit, type, isOnFlipped) {
if (isOnFlipped == undefined) {
isOnFlipped = true;
}
currentSuit = suit;
currentType = type;
if (isOnFlipped) {
gotoAndStop(28);
} else if (!isWild()) {
showFace();
} else {
gotoAndStop(27);
showFace();
}
}
function getType() {
return(currentType);
}
function getSuit() {
return(currentSuit);
}
function getCardId() {
return(SUITLIST.charAt(currentSuit + 2) + TYPELIST[currentType + 2]);
}
function isWild() {
return((currentSuit == SUIT_WILD) || (currentType == TYPE_WILD));
}
function suitAsString() {
switch (currentSuit) {
case SUIT_WILD :
return("wild");
case SUIT_CLUB :
return("club");
case SUIT_DIAMOND :
return("diamond");
case SUIT_HEART :
return("heart");
case SUIT_SPADE :
return("spade");
}
return(("unknown(suit=" + currentSuit) + ")");
}
function typeAsString() {
switch (currentType) {
case TYPE_WILD :
return("wild");
case TYPE_ACE :
return("ace");
case TYPE_TWO :
return("two");
case TYPE_THREE :
return("three");
case TYPE_FOUR :
return("four");
case TYPE_FIVE :
return("five");
case TYPE_SIX :
return("six");
case TYPE_SEVEN :
return("seven");
case TYPE_EIGHT :
return("eight");
case TYPE_NINE :
return("nine");
case TYPE_TEN :
return("ten");
case TYPE_JACK :
return("jack");
case TYPE_QUEEN :
return("queen");
case TYPE_KING :
return("king");
}
return(("unknown(type=" + currentType) + ")");
}
function toString() {
return(((((((((("Card[p=" + px) + ",") + py) + ", id=") + getCardId()) + ", suit=") + suitAsString()) + ", type=") + typeAsString()) + "]");
}
var SCALE = 100;
static var TYPE_UNKNOWN = -2;
static var TYPE_WILD = -1;
static var TYPE_TWO = 0;
static var TYPE_THREE = 1;
static var TYPE_FOUR = 2;
static var TYPE_FIVE = 3;
static var TYPE_SIX = 4;
static var TYPE_SEVEN = 5;
static var TYPE_EIGHT = 6;
static var TYPE_NINE = 7;
static var TYPE_TEN = 8;
static var TYPE_JACK = 9;
static var TYPE_QUEEN = 10;
static var TYPE_KING = 11;
static var TYPE_ACE = 12;
static var SUIT_UNKNOWN = -2;
static var SUIT_WILD = -1;
static var SUIT_CLUB = 0;
static var SUIT_DIAMOND = 1;
static var SUIT_HEART = 2;
static var SUIT_SPADE = 3;
static var MIN_CARDTYPE = TYPE_TWO;
static var MAX_CARDTYPE = TYPE_ACE;
static var MIN_CARDSUIT = SUIT_CLUB;
static var MAX_CARDSUIT = SUIT_SPADE;
static var TYPELIST = ["?", "w", "2", "3", "4", "5", "6", "7", "8", "9", "10", "j", "q", "k", "a"];
static var SUITLIST = "?wcdhs";
}
Symbol 116 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 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();
x = x >> 0;
var _local4 = false;
if (((x >= targetX) && (targetX >= startX)) || ((x <= targetX) && (targetX <= startX))) {
_local4 = true;
x = targetX;
}
var _local3 = false;
y = y >> 0;
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 117 MovieClip [__Packages.com.midasplayer.timing.IFloat] Frame 0
class com.midasplayer.timing.IFloat
{
var lastValue, value;
function IFloat () {
}
function set(newValue) {
lastValue = value;
value = newValue;
}
function get(alpha) {
return(lastValue + ((value - lastValue) * alpha));
}
}
Symbol 118 MovieClip [__Packages.midasplayer.CardClickListener] Frame 0
interface midasplayer.CardClickListener
{
}
Symbol 119 MovieClip [__Packages.com.midasplayer.util.EaseOutCubicAnimator] Frame 0
class com.midasplayer.util.EaseOutCubicAnimator extends com.midasplayer.util.Animator
{
var dt, duration, x, startX, dx, y, startY, dy;
function EaseOutCubicAnimator (o) {
super(o);
}
function nextPosition() {
var _local3 = dt;
if (_local3 > duration) {
_local3 = duration;
}
var _local2 = _local3;
_local2 = (_local2 / duration) - 1;
x = (dx * (((_local2 * _local2) * _local2) + 1)) + startX;
_local2 = _local3;
_local2 = (_local2 / duration) - 1;
y = (dy * (((_local2 * _local2) * _local2) + 1)) + startY;
}
}
Symbol 120 MovieClip [__Packages.midasplayer.Pyramini] Frame 0
class midasplayer.Pyramini extends midasplayer.MidasGame implements midasplayer.Game
{
var pointLabels, timeUsed, timeEnd, roundNum, score, lastTick, endAtTick, exitTick, timeQuit, nextTickSnd, isGameExited, isCountingBonus, parent, scoreDigits, gameSeed, playTimeLeft, mainTimer, animGubbe, alphaAnimGubbe, alphaSlaveGubbe, gubbe, alphaAnimGubbe2, alphaSlaveGubbe2, zoomAnimGubbe, zoomSlaveGubbe, deck, timeBeginCountBonus, bonusDigits, lastCardsLeft, isRoundOver, startGameAt, ticking, lastCombo, longestSeries, currentSeries, isGameOver, finalBonusScore;
function Pyramini (aParent) {
super(aParent);
pointLabels = [];
timeUsed = 0;
timeEnd = 0;
roundNum = 0;
score = 0;
lastTick = 0;
endAtTick = -1;
exitTick = -1;
timeQuit = -1;
nextTickSnd = 0;
isGameExited = false;
isCountingBonus = false;
parent.time_digit_1.gotoAndStop(3);
parent.time_digit_2.gotoAndStop(6);
scoreDigits = parent.score_digits;
scoreDigits.setValue(0);
scoreDigits.update();
parent.sound_switch.gotoAndStop(2);
parent.exit_btn.onPress = mx.utils.Delegate.create(this, quit);
parent.sound_switch.onPress = mx.utils.Delegate.create(this, toggleSound);
}
function toggleSound() {
if (com.midasplayer.fx.SoundManager.isSoundEnabled()) {
com.midasplayer.fx.SoundManager.enableSounds(false);
parent.sound_switch.gotoAndStop(1);
} else {
com.midasplayer.fx.SoundManager.enableSounds(true);
parent.sound_switch.gotoAndStop(2);
}
}
function init(gda) {
gameSeed = int(gda.getGameData("randomseed"));
playTimeLeft = 25000;
parent.card_positions._visible = false;
parent.platta._visible = false;
begin();
}
function begin() {
prepareNextRound();
fscommand ("gameStart");
submitPlayData((("7,0," + gameVersion) + ",0=") + score);
}
function exit() {
if (!isGameExited) {
fscommand ("gameQuit");
isGameExited = true;
}
}
function quit() {
exitTick = lastTick + mainTimer.getMillisPerTick();
fscommand ("gameEnd", "" + score);
}
function tick(tick) {
if (animGubbe) {
if (animGubbe.update()) {
animGubbe = undefined;
}
}
if (alphaAnimGubbe) {
if (alphaAnimGubbe.update()) {
alphaAnimGubbe = undefined;
} else {
gubbe._alpha = alphaSlaveGubbe._x;
}
}
if (alphaAnimGubbe2) {
if (alphaAnimGubbe2.update()) {
alphaAnimGubbe2 = undefined;
} else {
gubbe._alpha = alphaSlaveGubbe2._x;
}
}
if (zoomAnimGubbe) {
if (zoomAnimGubbe.update()) {
zoomAnimGubbe = undefined;
} else {
gubbe._xscale = (gubbe._yscale = zoomSlaveGubbe._y);
}
}
for (var _local5 in pointLabels) {
var _local2 = pointLabels[_local5];
if (_local2.animator.update()) {
_local2.clip.removeMovieClip();
delete pointLabels[_local5];
} else {
_local2.clip._alpha = Math.floor(_local2.animator.getElapsed() * 100);
}
}
deck.update(tick);
if (timeBeginCountBonus == tick) {
beginCountBonus();
}
if (scoreDigits) {
scoreDigits.update();
}
if (bonusDigits) {
if (isCountingBonus && (bonusDigits.isFinished())) {
isCountingBonus = false;
timeQuit = tick + mainTimer.getMillisPerTick();
} else {
bonusDigits.update();
}
}
if (timeQuit == tick) {
exit();
return(undefined);
}
if (((!isGameExited) && (exitTick != -1)) && (tick > exitTick)) {
onEndGame(lastCardsLeft);
return(undefined);
}
if (tick == endAtTick) {
onEndGame(lastCardsLeft);
return(undefined);
}
lastTick = tick;
if ((!isRoundOver) && (endAtTick == -1)) {
var _local4 = playTimeLeft - (timeUsed * mainTimer.getMillisPerTick());
if (startGameAt != -1) {
_local4 = _local4 - (timeUsed + ((tick - startGameAt) * mainTimer.getMillisPerTick()));
}
parent.time_digit_1.gotoAndStop(1 + (Math.floor(_local4 / 10000) % 10));
parent.time_digit_2.gotoAndStop(1 + (Math.floor(_local4 / 1000) % 10));
if ((!ticking) && (_local4 < 5000)) {
ticking = setInterval(mx.utils.Delegate.create(this, doMoreTick), 560);
var _local8 = new Color(parent.time_digit_1);
var _local7 = new Color(parent.time_digit_2);
var _local6 = {ra:100, ga:100, ba:100, aa:100, rb:100, gb:-55, bb:-55, ab:0};
_local8.setTransform(_local6);
_local7.setTransform(_local6);
}
if (_local4 == 0) {
onEndGame(lastCardsLeft);
return(undefined);
}
}
}
function doMoreTick() {
com.midasplayer.fx.SoundManager.play("tick");
}
function render(tick, alpha) {
deck.render(tick, alpha);
}
function updateNumbers() {
scoreDigits.setValue(score);
}
function prepareNextRound() {
if (deck) {
deck.destroy();
}
roundNum++;
lastCombo = 0;
startGameAt = -1;
longestSeries = 0;
currentSeries = 0;
isRoundOver = false;
isGameOver = false;
deck = new midasplayer.Deck(parent, this, 380, 160, gameSeed);
gubbe = parent.attachMovie("gubbe_aligned", "bugge", parent.getNextHighestDepth());
gubbe._x = 416;
gubbe._y = 100;
animGubbe = new com.midasplayer.util.EaseOutCubicAnimator(gubbe);
animGubbe.setPosition(416, 34);
animGubbe.setDuration(2500);
zoomSlaveGubbe = {_x:100, _y:200};
zoomAnimGubbe = new com.midasplayer.util.EaseOutCubicAnimator(zoomSlaveGubbe);
zoomAnimGubbe.setCallback(0.55, mx.utils.Delegate.create(this, beginDealCards));
zoomAnimGubbe.setPosition(100, 10.5);
zoomAnimGubbe.setDuration(2500);
com.midasplayer.fx.SoundManager.play("intro");
updateNumbers();
}
function beginDealCards() {
alphaSlaveGubbe = {_x:100, _y:0};
alphaAnimGubbe = new com.midasplayer.util.EaseOutCubicAnimator(alphaSlaveGubbe);
alphaAnimGubbe.setPosition(0, 0);
alphaAnimGubbe.setDuration(1000);
var _local3 = deck.getRandomNumber(LAYUP_TABLE.length);
var _local2 = parent.attachMovie(LAYUP_PH_TABLE[_local3], "current_placeholder", parent.getNextHighestDepth());
_local2._x = 0;
_local2._y = 0;
_local2._visible = false;
lastCardsLeft = deck.beginDistribute(LAYUP_TABLE[_local3], _local2);
com.midasplayer.fx.SoundManager.play("cards_laid_out");
parent.numcards_txt.text = lastCardsLeft;
}
function onBeginRound(tick) {
startGameAt = tick;
deck.showFaces();
isRoundOver = false;
}
function onIllegalClick(aCard) {
com.midasplayer.fx.SoundManager.play("click");
score = score - 50;
score = Math.max(0, score);
parent.score_txt.text = "score: " + score;
updateNumbers();
submitPlayData(((("15," + lastTick) + ",") + aCard.getCardId()) + ",0=-50");
}
function cleared() {
alphaSlaveGubbe = {_x:0, _y:0};
gubbe.removeMovieClip();
gubbe = parent.attachMovie("gubbe_aligned", "bugge", parent.getNextHighestDepth());
gubbe._alpha = 0;
gubbe._x = 416;
gubbe._y = 34;
gubbe._yscale = (gubbe._xscale = 10.5);
alphaAnimGubbe = new com.midasplayer.util.EaseOutCubicAnimator(alphaSlaveGubbe);
alphaAnimGubbe.setCallback(1, mx.utils.Delegate.create(this, beginZoomOutInkaGuy));
alphaAnimGubbe.setPosition(100, 0);
alphaAnimGubbe.setDuration(500);
}
function beginZoomOutInkaGuy() {
com.midasplayer.fx.SoundManager.play("golden_head");
showFinalScore();
animGubbe = new com.midasplayer.util.EaseInQuadAnimator(gubbe);
animGubbe.setPosition(416, 100);
animGubbe.setDuration(2000);
zoomAnimGubbe = new com.midasplayer.util.EaseOutCubicAnimator(zoomSlaveGubbe);
zoomAnimGubbe.setCallback(1, mx.utils.Delegate.create(this, beginCountBonus));
zoomAnimGubbe.setPosition(0, 100);
zoomAnimGubbe.setDuration(2000);
}
function showFinalScore() {
bonusDigits = midasplayer.ArcadeNumbers(parent.attachMovie("digits", "bonus_digits", parent.getNextHighestDepth()));
bonusDigits._x = 405;
bonusDigits._y = 75;
bonusDigits.setValue(finalBonusScore);
bonusDigits.setCountAmount(-1);
bonusDigits.update();
}
function beginCountBonus() {
var _local2 = 51;
isCountingBonus = true;
bonusDigits.setCountAmount(_local2);
bonusDigits.setValue(0);
scoreDigits.setCountAmount(_local2);
scoreDigits.setValue(score + finalBonusScore);
return(undefined);
}
function failed() {
com.midasplayer.fx.SoundManager.play("jaildoor");
showFinalScore();
timeBeginCountBonus = lastTick + mainTimer.getMillisPerTick();
}
function onEndGame(cardsLeft, delayed) {
if (delayed) {
lastCardsLeft = cardsLeft;
endAtTick = lastTick + mainTimer.getMillisPerTick();
return(undefined);
}
if (isGameOver) {
exit();
return(undefined);
}
clearInterval(ticking);
var _local5 = 0;
var _local2 = 0;
var _local4 = 0;
var _local6 = deck.getNumCardsLeft();
if (_local6 == 0) {
_local4 = 100;
_local5 = cardsLeft * 25;
if (!deck.hasUsedWildCard()) {
_local2 = 200;
}
}
finalBonusScore = (((longestSeries * 50) + _local2) + _local5) + _local4;
var _local3 = finalBonusScore + score;
deck.destroy();
isRoundOver = true;
isGameOver = true;
exitTick = -1;
endAtTick = -1;
submitPlayData((("8," + lastTick) + ",0=") + _local3);
fscommand ("gameEnd", "" + _local3);
if (_local6 > 0) {
failed();
} else {
cleared();
}
}
function onCardsCombined(openCard, pyramidCard) {
com.midasplayer.fx.SoundManager.play("click");
var _local7 = lastTick - lastCombo;
lastCombo = lastTick;
var _local8 = 0;
var _local4 = 5 * mainTimer.getMillisPerTick();
if (_local7 < _local4) {
_local8 = Math.round(10 * ((_local4 - _local7) / _local4));
}
var _local3 = (100 + (currentSeries * 50)) + _local8;
score = score + _local3;
var _local6 = parent.getNextHighestDepth();
var _local2 = parent.attachMovie("points", "pts" + _local6, _local6);
_local2._x = 400;
_local2._y = 180;
_local2.pts.text = _local3;
var _local5 = new com.midasplayer.util.EaseOutCubicAnimator(_local2);
_local5.setPosition(400, 100);
_local5.setDuration(1500);
pointLabels.push({clip:_local2, animator:_local5});
currentSeries++;
longestSeries = Math.max(currentSeries, longestSeries);
updateNumbers();
submitPlayData((((((("13," + lastTick) + ",") + openCard.getCardId()) + ",") + pyramidCard.getCardId()) + ",0=") + _local3);
}
function onDrawNewCard(newOpenCard, cardsLeft) {
lastCardsLeft = cardsLeft;
if (!newOpenCard.isWild()) {
currentSeries = 0;
com.midasplayer.fx.SoundManager.play("new_card_from_hand");
} else {
com.midasplayer.fx.SoundManager.play("wildcard");
}
parent.numcards_txt.text = lastCardsLeft;
submitPlayData(((("14," + lastTick) + ",") + newOpenCard.getCardId()) + ",0=0");
}
function submitPlayData(a) {
fscommand ("playData", a);
}
static var gameVersion = "1.01";
static var LAYUP_36 = [[], [], [], [], [], [], ["f1", "f2"], ["f2", "f3"], ["f3", "f4"], ["f4", "f5"], ["f5", "f6"], ["e7", "e8"], ["e8", "e9"], ["e9", "e10"], ["e10", "e11"], ["d12", "d13"], ["d13", "d14"], ["d14", "d15"]];
static var LAYUP_148 = [[], [], [], [], [], [], [], [], ["f1", "f2"], ["f2", "f3"], ["f3", "f4"], ["f4", "f5"], ["f5", "f6"], ["f6", "f7"], ["f7", "f8"], ["e11", "e12"], ["e12", "e13"], ["d16", "d17"]];
static var LAYUP_27 = [[], [], [], [], [], [], [], ["f1", "f2"], ["f2", "f3"], ["f3", "f4"], ["f4", "f5"], ["f5", "f6"], ["f6", "f7"], ["e8", "e9"], ["e9", "e10"], ["e11", "e12"], ["e12", "e13"], ["d14", "d15"], ["d16", "d17"]];
static var LAYUP_18 = [[], [], [], [], [], [], ["f1", "f2"], ["f2", "f3"], ["f3", "f4"], ["f4", "f5"], ["f5", "f6"], ["e7", "e8"], ["e10", "e11"]];
static var LAYUP_15 = [[], [], [], [], [], ["f1", "f2"], ["f2", "f3"], ["f3", "f4"], ["f4", "f5"], ["e6", "e7"], ["e7", "e8"], ["e8", "e9"], ["d10", "d11"], ["d11", "d12"], []];
static var LAYUP_TABLE = [LAYUP_36, LAYUP_27, LAYUP_18, LAYUP_148, LAYUP_15];
static var LAYUP_PH_TABLE = ["card_placeholder_36", "card_placeholder_27", "card_placeholder_18", "card_placeholder_148", "card_placeholder_15"];
static var LAYUP_LIST_TABLE = ["d14,c18,c17,c16,d12,e7,d15,d13,e11,e10,e9,e8,f6,f5,f4,f3,f2,f1", "c18,d14,e8,f7,c19,d17,d16,d15,e13,e12,e11,e10,e9,f6,f5,f4,f3,f2,f1", "d14,c18,c17,d16,d15,d13,d12,e11,e6,e10,e9,e8,e7,f5,f4,f3,f2,f1", "c20,d18,d17,d19,d16,e13,e12,e11,f1,e15,e9,e14,f8,e10,f7,f6,f5,f4,f3,f2", "b15,c13,d10,e6,c14,d12,d11,e9,e8,e7,f5,f4,f3,f2,f1"];
}
Symbol 121 MovieClip [__Packages.midasplayer.ArcadeNumbers] Frame 0
class midasplayer.ArcadeNumbers extends MovieClip
{
var value, targetValue, maxAmount, digits;
function ArcadeNumbers () {
super();
value = -1;
targetValue = 0;
maxAmount = -1;
digits = [];
var _local4 = 1;
var _local3;
while (_local3 = this["digit_" + _local4] , _local3 != undefined) {
digits.push(_local3);
_local4++;
}
if (digits.length == 0) {
throw ("Error: " + this) + " instance of midasplayer.ArcadeNumbers: no subclips named digit_1, digit_2 ...";
}
}
function setCountAmount(val) {
maxAmount = val;
}
function setValue(num, numPadDigits) {
targetValue = num;
}
function isFinished() {
return(targetValue == value);
}
function update() {
if ((targetValue < 0) || (targetValue == value)) {
return(undefined);
}
if (maxAmount != -1) {
if (targetValue > value) {
var _local5 = Math.min(maxAmount, targetValue - value);
value = value + _local5;
}
if (targetValue < value) {
var _local5 = Math.min(maxAmount, value - targetValue);
value = value - _local5;
}
} else {
value = targetValue;
}
var _local4 = digits.length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = Math.pow(10, (_local4 - _local2) - 1);
digits[_local2].gotoAndStop(1 + (Math.floor(value / _local3) % 10));
_local2++;
}
}
}
Symbol 122 MovieClip [__Packages.midasplayer.Deck] Frame 0
class midasplayer.Deck implements midasplayer.CardClickListener
{
var game, deckX, deckY, parent, random, availableCards, cards, wildCard, wildCardLeft, cardsLeftInDeck, openCardOffsetX, openCardOffsetY, distributionDone, distributionStarted, openCard;
function Deck (deckParent, game, deckX, deckY, aSeed) {
this.game = game;
this.deckX = deckX;
this.deckY = deckY;
parent = deckParent;
random = new com.midasplayer.util.Random(aSeed);
availableCards = new com.midasplayer.util.ArrayList();
var _local5 = midasplayer.Card.MIN_CARDSUIT;
while (_local5 <= midasplayer.Card.MAX_CARDSUIT) {
var _local3 = midasplayer.Card.MIN_CARDTYPE;
while (_local3 <= midasplayer.Card.MAX_CARDTYPE) {
var _local4 = parent.getNextHighestDepth();
var _local2 = midasplayer.Card(parent.attachMovie("card_2", "aCard_" + _local4, _local4));
_local2.addClickListener(this);
_local2.setKind(_local5, _local3, true);
_local2.setPosition(deckX, deckY, true);
_local2.setCardInDeck(true);
availableCards.insert(_local2);
_local3++;
}
_local5++;
}
cards = new com.midasplayer.util.ArrayList();
while (availableCards.size() > 0) {
var _local6 = midasplayer.Card(availableCards.removeByIndex(random.nextInt(availableCards.size())));
_local6.swapDepths(parent.getNextHighestDepth());
cards.insert(_local6);
}
var _local9 = parent.getNextHighestDepth();
wildCard = midasplayer.Card(parent.attachMovie("card_2", "wildCard_" + _local9, _local9));
wildCard.addClickListener(this);
wildCard.setPosition(deckX - 90, deckY, true);
wildCard.setKind(midasplayer.Card.SUIT_WILD, midasplayer.Card.TYPE_WILD, false);
wildCard.setHighlightEnabled(false);
wildCardLeft = 1;
cardsLeftInDeck = cards.size();
openCardOffsetX = 40;
openCardOffsetY = 0;
distributionDone = false;
distributionStarted = false;
}
function destroy() {
var _local3 = cards.__get__iterator();
while (_local3.hasNext()) {
var _local2 = midasplayer.Card(_local3.next());
_local2.removeClickListeners();
_local2.useHandCursor = false;
_local2.setHighlightEnabled(false);
_local2.onPress = undefined;
}
wildCard.removeClickListeners();
wildCard.setHighlightEnabled(false);
wildCard.onRelease = undefined;
wildCard.onReleaseOutside = undefined;
wildCard.useHandCursor = false;
openCard.removeClickListeners();
openCard.setHighlightEnabled(false);
openCard.useHandCursor = false;
}
function onClickCard(clicked) {
if (!distributionDone) {
return(undefined);
}
if (clicked.isCardInPyramid()) {
if (!clicked.isBlocked()) {
if (matches(clicked, openCard)) {
game.onCardsCombined(openCard, clicked);
openCard = clicked;
openCard.setCardInPyramid(false);
openCard.setCardInDeck(true);
openCard.swapDepths(parent.getNextHighestDepth());
openCard.moveTo(deckX + openCardOffsetX, deckY + openCardOffsetY, 0, false);
openCard.setHighlightEnabled(false);
if (getNumCardsLeft() == 0) {
game.onEndGame(cardsLeftInDeck);
return(undefined);
}
if (!canMakeMoreMoves()) {
game.onEndGame(cardsLeftInDeck);
}
return(undefined);
}
}
game.onIllegalClick(clicked);
return(undefined);
}
if (clicked.isCardInDeck() && (clicked != openCard)) {
if (clicked.isWild()) {
wildCardLeft = 0;
} else {
cardsLeftInDeck--;
}
openCard = clicked;
openCard.swapDepths(parent.getNextHighestDepth());
openCard.moveTo(deckX + openCardOffsetX, deckY + openCardOffsetY, 0, !clicked.isWild());
game.onDrawNewCard(openCard, cardsLeftInDeck);
if (!canMakeMoreMoves()) {
game.onEndGame(cardsLeftInDeck, true);
}
}
}
function hasUsedWildCard() {
return(wildCardLeft == 0);
}
function matches(a, b) {
var _local2 = false;
var _local4 = a.getType();
var _local3 = b.getType();
var _local5 = Math.abs(_local4 - _local3) % midasplayer.Card.MAX_CARDTYPE;
_local2 = _local2 | ((_local4 == midasplayer.Card.TYPE_ACE) && ((_local3 == midasplayer.Card.TYPE_TWO) || (_local3 == midasplayer.Card.TYPE_KING)));
_local2 = _local2 | ((_local3 == midasplayer.Card.TYPE_ACE) && ((_local4 == midasplayer.Card.TYPE_TWO) || (_local4 == midasplayer.Card.TYPE_KING)));
_local2 = _local2 | (_local5 == 1);
_local2 = _local2 | openCard.isWild();
return(_local2);
}
function canMakeMoreMoves() {
if ((cardsLeftInDeck > 0) || (wildCardLeft > 0)) {
return(true);
}
var _local3 = cards.__get__iterator();
while (_local3.hasNext()) {
var _local2 = midasplayer.Card(_local3.next());
if ((_local2.isCardInPyramid() && (!_local2.isBlocked())) && (matches(_local2, openCard))) {
return(true);
}
}
return(false);
}
function getNumCardsLeft() {
var _local4 = 0;
var _local2 = cards.__get__iterator();
while (_local2.hasNext()) {
var _local3 = midasplayer.Card(_local2.next());
if (_local3.isCardInPyramid()) {
_local4++;
}
}
return(_local4);
}
function beginDistribute(currentLayup, placeholder) {
var _local2 = new Array();
for (var _local5 in placeholder) {
_local2.push([_local5.substring(0, 1), parseInt(_local5.substring(1)), _local5]);
}
var _local5 = 0;
while (_local5 < _local2.length) {
var _local3 = 0;
while (_local3 < _local2.length) {
if (_local2[_local5][1] > _local2[_local3][1]) {
var _local4 = _local2[_local3];
_local2[_local3] = _local2[_local5];
_local2[_local5] = _local4;
}
_local3++;
}
_local5++;
}
var _local12 = {};
_local5 = 0;
while (_local5 < _local2.length) {
var _local15 = _local2[_local5][1];
var _local13 = _local2[_local5][0];
var _local8 = _local13 + _local15;
var _local9 = placeholder[_local8];
var _local16 = _local9._x;
var _local14 = _local9._y;
var _local6 = midasplayer.Card(cards.get(parseInt(_local5)));
_local6.moveTo(_local16, _local14, 30 * _local5, false);
_local6.setHighlightEnabled(true);
cardsLeftInDeck--;
_local6.swapDepths(_local6._parent.getNextHighestDepth());
_local12[_local8] = _local6;
_local5++;
}
openCard = midasplayer.Card(cards.get(_local2.length));
openCard.moveTo(deckX + openCardOffsetX, deckY + openCardOffsetY, 1000, true);
cardsLeftInDeck--;
_local5 = 0;
while (_local5 < _local2.length) {
var _local6 = midasplayer.Card(cards.get(parseInt(_local5)));
var _local15 = _local2[_local5][1];
var _local11 = null;
var _local10 = null;
var _local7 = currentLayup[_local15 - 1];
if (_local7.length > 0) {
_local11 = _local7[0];
_local10 = _local7[1];
}
_local6.setBlockedBy(midasplayer.Card(_local12[_local11]), midasplayer.Card(_local12[_local10]));
_local6.setCardInPyramid(true);
_local6.setCardInDeck(false);
_local5++;
}
distributionStarted = true;
return(cardsLeftInDeck);
}
function showFaces() {
var _local3 = cards.__get__iterator();
while (_local3.hasNext()) {
var _local2 = midasplayer.Card(_local3.next());
if (_local2.isCardInPyramid()) {
_local2.showFace();
}
}
}
function getRandomNumber(upperLimit) {
return(random.nextInt(upperLimit));
}
function update(tick) {
var _local4 = false;
var _local3 = cards.__get__iterator();
while (_local3.hasNext()) {
var _local2 = midasplayer.Card(_local3.next());
_local2.update(tick);
_local4 = _local4 || (_local2.isMoving());
}
if ((distributionStarted && (!distributionDone)) && (!_local4)) {
distributionDone = true;
game.onBeginRound(tick);
}
wildCard.update(tick);
openCard.update(tick);
}
function render(tick, alpha) {
var _local2 = cards.__get__iterator();
while (_local2.hasNext()) {
var _local3 = midasplayer.Card(_local2.next());
_local3.render(tick, alpha);
}
wildCard.render(tick, alpha);
openCard.render(tick, alpha);
}
}
Symbol 123 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 next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
s = int(s);
var _local5 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
mti = 1;
while (mti < N) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local6 = getTimer();
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
var _local4 = getTimer();
var _local2 = 0;
_local2 = 0;
while (_local2 < (N - M)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + M] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
while (_local2 < (N - 1)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + (M - N)] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
_local3 = (mta[N - 1] & UPPER_MASK) | (mta[0] & LOWER_MASK);
mta[N - 1] = (mta[M - 1] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
mti = 0;
var _local5 = 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 124 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] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
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 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
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 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_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 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_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 toString() {
return(((((("Integer64[value=0x" + com.midasplayer.util.Numbers.dec2hex(msb)) + ":") + com.midasplayer.util.Numbers.dec2hex(lsb)) + ":(") + p) + ")]");
}
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;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 125 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 126 MovieClip [__Packages.com.midasplayer.util.ArrayList] Frame 0
class com.midasplayer.util.ArrayList
{
var value;
function ArrayList (ar) {
if (ar == undefined) {
value = new Array();
} else {
value = ar;
}
}
function insert(obj, pos) {
var _local2 = value.length;
if ((pos == undefined) || (pos >= _local2)) {
value.push(obj);
return(_local2);
}
value.splice(pos, 0, obj);
return(pos);
}
function get(pos) {
return(value[pos]);
}
function set(pos, o) {
value[pos] = o;
}
function indexOf(obj) {
var _local2 = 0;
while (_local2 < value.length) {
if (obj == value[_local2]) {
return(_local2);
}
_local2++;
}
return(-1);
}
function remove(obj) {
return(removeByIndex(indexOf(obj)));
}
function removeByIndex(pos) {
var _local2;
var _local4 = value.length;
if ((pos < _local4) && (pos >= 0)) {
_local2 = value[pos];
value.splice(pos, 1);
}
return(_local2);
}
function size() {
return(value.length);
}
function clear() {
value = new Array();
}
function toArray() {
return(value);
}
function foreach(fn) {
var _local2 = 0;
var _local3 = value.length;
while (_local2 < _local3) {
if (fn(_local2, value[_local2]) == false) {
break;
}
_local2++;
}
}
function sortOn(field) {
value.sortOn(field);
}
function sort() {
value.sort();
}
function get iterator() {
return(new com.midasplayer.util.ArrayListIterator(this));
}
function subList(from, to) {
if ((to > value.length) || (!to)) {
to = value.length;
}
var _local4 = value.slice(from, to);
var _local3 = new com.midasplayer.util.ArrayList(_local4);
return(_local3);
}
}
Symbol 127 MovieClip [__Packages.com.midasplayer.util.ArrayListIterator] Frame 0
class com.midasplayer.util.ArrayListIterator implements com.midasplayer.util.Iterator
{
var ptr, list;
function ArrayListIterator (list) {
ptr = 0;
this.list = list;
}
function next() {
if (ptr < list.size()) {
return(list.get(ptr++));
}
return(undefined);
}
function hasNext() {
return(ptr < list.size());
}
function remove() {
if (ptr == 0) {
return(undefined);
}
list.removeByIndex(ptr - 1);
}
}
Symbol 128 MovieClip [__Packages.com.midasplayer.fx.SoundManager] Frame 0
class com.midasplayer.fx.SoundManager
{
function SoundManager () {
}
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)) {
var _local2 = getCalibratedVolume(percent);
if (!_local1.isMuted) {
_local1.sound.setVolume(_local2);
}
_local1.realVol = _local2;
}
}
static function isPlaying(resource) {
var _local1 = sounds.get(resource);
return((_local1 != undefined) && (_local1.playStatus == true));
}
static function initialize(list) {
for (var _local9 in list) {
var resource = list[_local9];
var _local3 = _root.getNextHighestDepth();
var _local2 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local3, _local3));
_local2.attachSound(resource);
_local2.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
};
sounds.put(resource, {realVol:100, sound:_local2, playStatus:false});
}
}
static function play(resource, volume, isLoop, fn) {
if (volume == undefined) {
volume = 100;
}
if (isLoop == undefined) {
isLoop = false;
}
volume = getCalibratedVolume(volume);
var _local2 = sounds.get(resource);
if (_local2 != undefined) {
_local2.sound.setVolume((soundEnabled ? (volume) : 0));
_local2.realVol = volume;
_local2.isMuted = !soundEnabled;
_local2.playStatus = true;
_local2.onPlayedFn = fn;
_local2.sound.start(0, (isLoop ? 32767 : 1));
} else {
var _local6 = _root.getNextHighestDepth();
var _local4 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local6, _local6));
_local4.attachSound(resource);
_local4.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
com.midasplayer.fx.SoundManager.onPlayed_(resource);
};
_local4.setVolume((soundEnabled ? (volume) : 0));
_local4.start(0, (isLoop ? 32767 : 1));
sounds.put(resource, {isMuted:!soundEnabled, realVol:volume, onPlayedFn:fn, sound:_local4, playStatus:true});
}
}
static function onPlayed_(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.onPlayedFn != undefined)) {
_local1.onPlayedFn();
}
}
static var sounds = new com.midasplayer.util.Map();
static var soundEnabled = true;
}
Symbol 129 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);
}
}